(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "Compute! Magazine Issue 009"

Doubiie-Density 
Graphing On 
The OSI CTP 



The 6502 Resource Magazine 
PET • Apple • Atari • OSi • KIM • SYM • AIM 



Character 

Generation 

On The Atari 



COMPUTE! 

The Journal For Progressive Computing 



$2,50 
February, 
1981 
Issue 9 
Vol. 3, No. 2 

6337<P 



Ticker Tape 
Messages 
On The Atari 



RTftBI DOES 



«• • •' 



• • • •• 



The 25^ Apple II 
Real Time Clock 



Mixing And 
Matching 
Commodore 
Disk Systems 



Crash 
Prevention 
For Your PET 



I>"4 4>'6'l6 3 37 9 



02 




0-. 




1 


ita 


bJ 



Mountain Computer makes 
more peripherals for 
the Apple Computer 
than Anybody. 




inhiolx-io 



hts and 
lies and 

energy conservation. Complete applications 
software package. Home security with random 
ge accounting package lor 
(IfOf. No wrring required 



and ... a place to put them 



^B^M,- 



APPLE CLOCl 



tion Interrupts 
._Dnd operation of 
two programs simultaneously. Battery back-up. 

Crystal-controlled (or ■ OOIS accur ""' 

ROM for easy access from BAS 



iAttiii^ 






H 



SIIPERTALKER SD200^ 



i;f.y;:i:Liij;; 



raclive pro 
recteO activi 
foom. or sound "' 
as well as outpu 



-,-.ograms. I 'O capability 
.pted inputs. Use output (or 
announcements in a control- 
Easy to use because mput 
[.software operating system. 



ROMWRITER 



LUS+ 




reate your own firmware. 

lis Disk software package 

provides easy EPROM programming EPROMs are verified 

after BURfe^By|J^wuyi{ograms from on-board socket or 

install ttiepi^HB^^fc 



.n uirough firmware Six sockets 
OM equivalents. Six or any com- 

.;e Scratch-pad RAfi/l and two TTL 

connectors. Special 2K ROfvls available for powerful system 
enhancement Keyboard Filter ROI^—COPYROM— Others 
coming soon 



Mustcsystem 



„ „nly on 
.me com- 
u .i.strumental 
music synthesizer system 16 voices in 
stereo Instrument definitions simulate the 
sound of real instruments— and more Fully 
programmable waveforms Envelope Con- 
trol Composition system—sheet music 
input usmg standard music notation. 
Chords and multi-part scoring up to 16 
voices^ true instrument that anyone with 



A/D+D/A 



....tjut.te 

analog output, 
in. Super-fast 9;; 
sec. conversibn time. Monitor and 
output to the real world. All on one 
card 



■^ aril niiai»<iKT«iii i([»i 



EXPANSION CH IVSSIS 



!witMi}f i^Kia II L^scK 1 1 li^M'i'i: v^a km 1 1 K'ivii t 



duly power, 
in Expansio 

Apple. Only one additional commanC to specify 
in Apple or m Expansion Chassis Compatibfewith 
.all Apple peripherals. 




At last' An intelligent, high-quality device for 
data entry from user-marked cards, implement 
BASIC programming, examination scoring, 
inventory maintenance and other applications 
requiring off-line data preparation for batch 
entry later. Connects to any computer having 
RS-232 interface. Software and cards are 
available for jobs in business, science and 
education. 

MOUNTAIN COfvlPUTER has the most compre- 
hensive hne of Apple peripherals available 
Anywere From anybody. We know the Apple 
inside and out and are commitled to providing 
the mcsl innovative and unique products to 
expand and enhance its capabilities and use 
After all. we were (he first company to make an 
Apple peripheral— except Apple Computer. 

Available at Apple Dealers worldwide. 



300 Harvey West Blvd.. Santa Cruz, CA 95060 
(408) 429-8600 , |7^&fl|lO^'*504 



bed calalous— ' ( '■ 13S0 



Apple IS a Irademark ol Apple Computif Inc. 



IF YOU'RE WAITING FOR THE 

PRICE OF WORD PROCESSORS 

TO FALL WITHIN REASON, 




^^^^^^^^^^^^^p 





Everyone expected ft would tiappen 
sooner or later. . . witti WordPro PLUS'" 
it already has! Now all the marvelous 
benefits of expensive and advanced 
word processing systems are available 
on Commodore computers, America's 
largest selling computer line. WordPro 
PLUS, when combined with the new 80 
column CBM 8032, creates a word pro- 
cessing system comparable to virtually 
any other top quality word processor 
available— but at savings of thousands 
of dollars! 



New, low cost computer technology is 
now available at a fraction of what you 
would expect to pay. This technology 
allowed Commodore to introduce the 
new and revolutionary CSM 8032 
Computer. 

WordPro PLUS turns this new CBM 
8032 Computer into a sophisticated, 
time saving word processing tool. With 
WordPro PLUS, documents are dis- 
played on the computer's screen. Edit- 
ing and last minute revisions are simple 
and easy. No more lengthy re-typing 
sessions. Letters and documents are 
easily re-called from memory storage 
for editing or printing with final drafts 
printed perfectly at over five hundred 
words per minute! 



Our nationwide team of professional 
dealers will show you how your office 
will benefit by using WordPro PLUS. At 
a price far less than you realize. 



Invest in your office's future. . . 
invest in WordPro PLUS. . . 
Call us today for the name of the 
WordPro PLUS dealer nearest you. 



Professional Software Inc. 

166 Crescent Road 
Needham, MA 02194 
(617)444-5224 
TELEX 95 1579 




You probably know 
about the SoftCard— our 
ingenious circuit card that 
converts an Apple II ' into a 
Z-BO" machine running 
CP/M'."' 

You may even know 
that with the SoftCard, you get Microsoft's 
powerful BASIC— extended to support 
Apple graphics and many other features. 

Now, whenever you're ready to get beyond the 
BASICS, the SoftCard can take you into whole 
new realms. Starting with two advanced 
language packages from Microsoft 

FORTRAN AND 
COBOL TO GO. 

Now you can run the 
world's most popular 
engineering/scientific lan- 
guage and the most popular 
business language on your 

Apple. Think what that means; you can choose from liter- 
ally thousands of "off-the-shelf" applications programs, 
and have them working with little conversion. Or design 
your own programs, taking advantage of all the problem- 
solving power these specialized languages give you. 

FORTRAN-80 

A complete ANSI-standard FORTRAN {except 
COMPLEX type), with important enhancements. The ex- 
tremely fast compiler performs extensive code 



optimization, and, since 
it doesn't require a "P- 
code" interpreter at run 
time, your programs will 
typically execute 2-3 
times faster than with 
Apple FORTRAN. 

FORTRAN IS easy to 
learn if you know BASIC, 
and the package in- 
cludes a huge library of 
floating point, math, 
and I/O routines 
you can use in all 
your programs. 

COBOL-80 

Virtually the only choice for 
serious business data processing. 
It's ANS1 1974 standard COBOL, with many user-oriented 
features added: formatted screen support for CRT termi- 
nals, simple segmenting of very large programs, powerful 
file handling capabiiity. trace debugging, and much 
more. A separate Sort package is coming soon. 

FORTRAN-80 and COBOL-80 are just two more rea- 
sons why the Apple with SoftCard is the world's most ver- 
satile personal computer. Get all the exciting details from 
your Microsoft dealer today. And start getting beyond the 
BASICS. 

MICROSOFT Consumer Products, 400 108th Ave. 
N.E.. Suite 200, Bellevue, WA 98004. (206) 454-1315. 

SoltCardiBairaUerriarkoI MicrosoM Apple II is a registered Uademarkol Apple Com- 
puter. Inc Z-80isaregislereairadeTiarkolZilog,lnc CP/M is a legislerea trademark 
ol Digital Rosearcn. Inc 



/HKRpSOfT 



February. 1981 issue 9- 



COMPUTE! 



Table of Contents 



February, 1981, Vol. 3. No. 2 



The Editor's Notes Robert Lock. 4 

Beginner's Guide To COMPUTE! 5 

The Reader's Feedback Robert Lock ond Reoders. 6 

Writing For COMPUTE! 5 

Business Appiications Analysis: The Missing Step Hoi Wodleigh. 12 

LED- A Line-Oriented Text Editor ArnieLee. 16 

Review: The Atari 825 Printer Robert W Boker. 24 

Simulated Print Using Jim Butterfield. 3C 

The Mysterious And Unpredictable RND: 

Part 2 Bob Aibrecht ond George Firedroke. 34 

Stat Lab A Wochtel.42 

A BCD To Floating - Point Binary Routine Morx/m L DeJong, 46 

Basic Math For Fun And Profit J R Lowell. 54 

PET Spelling Lessons Your Students Can Prepare i ory Esbensen, 60 

List Apple Integer Basic Programs 

One Page At A Time Keith Folkner, 64 

The 25C Apple II Real Time Clock Eronn Got. 68 

The ATARI Gazette 74 

Ticker Tape Atari Messages Fnc Morlell ond Chris Murdock, 74 

Atari Colors And Sounds With Paddles Arthur Schreibmon, 75 

Atari As Terminal: A Short 

Communications Program Henrique Veludo. 75 

Character Generation On The Atari , Chorles Bronnon, 76 

The Atari Hall Of Fame: 

Iridis, Founding Member Croig Potchett, 78 

Review: Atori Music Composer Jerry White, 80 

Put A Printer On The Atari Ports C Kingston. 82 

The OSI Gazette 86 

Double-Density Graphing On The OSI CIP Gory Boden. 86 

A Small Operating System: 

OS65D, The Kernel: Part 2 of 3 Tom R. Berger. 88 

Book Review: Servicing Data For 

Computer Boards 600 And 610 Chorles L Stonford. 95 

The PET Gazette 97 

Contour Plotting Neol E Red. 97 

Relocate P D Young, 103 

Mixing And Matching Commodore Disk Systems . . , .Jim Butterfield. 104 

Memory Calendar Peter Spencer, 1C9 

Crash Prevention For The PET .Elizabeth Deol. 1 14 

Machine language Printer Command Zclton Szepesi, 116 

Odds & Ends On PFT/CBM Files Jim Butterfield, 118 

Three PET Tricks John F Gorst, 120 

Review: PASCAL On The PET A J. Bruey, 124 

Review: The PEDISK Dr J, A Dilts. 126 

Review: A Disk Operating System For 

The CGRS PEDISK Dr J A Dilts, 127 

The SBC Gazette 128 

A Terminal For "KAOS": (Kim, Aim, OSI, Sym) Bruce Lond. 128 

SYMple Clock AM MocKoy, 134 

Expanding KIM-Style 6502 Single-Board Computers 

Part 2 of 3: The Great Experiment Hal Chomberlin, 138 

Load And Save KIM Basic Programs On Your SYM . . . George Wells, 140 
Advertisers Index 144 



^f"^ 







rtTRor 



'^-^^i.^^ 



U^O 








(jju/^ 




<- 






/ 



COMPUTE! The Journal for Progressive Computing (USPS: 5H7250) is published VI liincs each viiir \)\ Snicill Sysnui S<tvi(i's. 
(Jici-nsliont, NC ilMVS USA. I'linnr: {919) ll'^-WiW?. Kiliiuii.i! im'uv^ ;irv lou.uil at 211(1 KaM lU-ssrnu-r Avt-.. C;n.-tnsbnn). NC 27401. 



I*.0. Box 5406, 



Domusiic Subscriptions: \2 issues, Slfi.'^H. Srjiti subsutption ordt-rs or chanirf olHcidrt-'ss (P.O. Korm ^579) to Cin ul.nion Dcpi.. COMPUTt! Nf.ii^azliK', P.O. 
Hox 3406, Grfcnsboro, NC 2740J. Cotitrnllrd ( ircubiiinn jjiisia^'f puiii ;u CJirrnsbora, NC' 27403. Application to mail ai finiuoIKitl riicnbuion latf,'? pcruiing at 
Hickory. NC.^ 2B6fl] . Ftuire (uiucnt*; cofjyrit^lii '^5 WWW by Small Sysicni Seiviti.'s. Inc. All rights rcsL*r\(d. ISSN 0194-3J7X. 



COMPUTE! 



February, 1981. Issue 9. 



Robert C. Lock, Publisher/ Editor 

Jorettc Klepfer, Manager, Dealer Marketing 

Carol Holmquist Lock, Circulation Manager 

Kathleen Martinek, Publication Assistant 

J. Gory Dean, Art Direction/Production 

Assistance 

COMPUTE receives continuing editorial 

assistance from the following persons: 

Han/ey Herman, University of North Carolina 

at Greensboro 

Jim Butterfield, Toronto, Canada 

Lorry Isaacs, Raleigh, NC 

The following writers contribute on a regular 

basis OS Contributing Editors: 

Al Baker, 2327 S. Westminster, Wheaton, IL 

60187 

Gene Beals, 115 E. Stump Road, Montgomery- 

ville, PA 18936 

Len Lindsay, 5501 Groveland Terrace, 

Madison, Wl 53716 

Roy O'Brien, P.O. Box 426. Beaumont, CA 

92223 

Subscription Information (12 Issue Year): 
COMPUTE. Circulation Dept. 
P.O. Box 5406 
Greensboro, NC 27403 USA 

U.S. $16.00 

Canada S18.O0 (U.S. funds) 

Europe: Surface Subscription, $20.00 (U.S. funds) if 

ordered direct or available in local currency 

from the following distributors: 

United Kingdom 

Contact L. P. Enterprises, 

8-11 Cambridge House 

Cambridge Road 

Barking. Essex 

England IGl 18NT 
Germany, 
Switzerland, 
Austria 
Contact Ing. W. Hofacker GMBH 

8 Munchen 75 

Postfach 437 

West Germany 
Canadian Retail Dealers should contact: 
Micron Distributing 
409 Queen Street West 
Toronto, Ontario M5V 2A5 
(416) 361-0609 

Authors of manuscripts warrant that all materials submitted to 
COr^lPUTE- are original moteriais with fuli ownership rights resi- 
dent in said authors. By submitting otticies to COfvlPUTE., authors 
acknowledge that such moteriais. upon acceptance for 
publication, become the exclusive property of Small System Ser- 
vices. Inc. No portion of this mogoiine may be reproduced in 
any form without written permission from the pubiisher. Entire 
contents copyright £ 1980, Small System Services, Inc. Programs 
developed and submitted by authors remain their property, with 
the exception that COMPUTE, reserves the right to reprint the 
moteriol, as originally published in COt^dPUTE, in future publica- 
tions. Unsolicited materiois not accepted for publication in COM- 
f'UTE, will be returned if author provides o self-oddressed, 
stamped envelope. Program listings should be provided in 
printed form (new ribbon) as well os machine readable form. Ar- 
ticles should be furnished os typed copy (upper and lower cose, 
please) with double spacing. Each page of your article should 
bear the title of the article, dote ond nome of the author 
COMPUTE, assumes no iiobility for errors in articles or adver- 
tisements. Opinions expressed by authors are not necessarily 
those of COfVlPUTE 

PET is a trademark of Commodore Business Machines, Inc. 
Apple is a trademark of Apple Computer Company. 
ATARI is a trademark of Atari, Inc, 



The Editor's 
Notes 

Robert Lock, Publisher/Editor 

Too Few Atarls 

Sucii a problem, . . We've been saying Atari sales are 
picking up, a more tiian gradual creep that's been in 
evidence since summer. The trickle has apparently 
turned into a roar: it seems the pipeline effectively 
ran dry in mid-December when dealers across the 
country were selling machines faster than they could 
get them. This translates, of course, into not selling; 
machines, since many dealers were unable to obtain 
enough. 'We've heard from some who said they could 
have sold many more, given sufficient supply. Don't 
give up Santa; it would still be quite appropriate for 
Valentine's day. And I suspect Atari corporate won't 
be caught short again. 

The International Commodore, 
Or, Bye Jack 

We've been persisting in these pages with claims that 
Commodore's getting it together in marketing. With 
the help of Dr. Chip, we've been trying to track the 
rapid changes in mid to upper level management. 
Commodore has been growing up as a corporate en- 
tity, and such growth is invariably replete with pro- 
blems in working out directions, helmsmen/women, 
and the like. 

Jack Tramiel, President and founder of Com- 
modore, has stepped out of the position of President. 
He will become Vice-Chairman of the Board of 
Directors and Chief Executive Officer. We suspect 
Jack's skills will be more directed to the long-range 
growth of the company, and less to the day to day 
operations and intermediate planning. In short, the 
move looks like a logical, progressive step in the 
growth of the company. 

The new President appears to be exceptionally 
well qualified to head a company such as Com- 
modore. His name is James Finke, and he comes to 
Commodore with a background that seems ideally 
suited. You have to understand that Commodore is 
truly an international company. The US has, in the 
past, made up a small portion of their overall 
market. Thus, they're relatively unique at the mo- 
ment among the competitive 6502 machine vendors. 

Their strength outside the US places them at 
number one in installed machines in Canada, 
England, Germany, and so on. In the US they've 
been running number three behind Tandy and Ap- 
ple. In spite of efforts to the contrary, their steps for 
improving the marketing channels in the US have 
been slow going, with problems with dealer support 
and supply being foremost. 



February, 1981. Issue 9, 



COMPUTE! 



The point of all this is that the new President, 
for corporate stability, will have to be able to get 
things rolling in the US, while maintaining the 
superiority in Europe. Mr. Finke appears to have 
such a background. A 1951 Physics graduate of 
Williams College, a Masters Degree in International 
Economics from Oxford University, and a Harvard 
Law degree. A history of experience leading from 
Vice President and General Manager of Motorola's 
communication division European Operations to 
General Manager of General Electric Medical Divi- 
sions International Operations to Vice President and 
General Manager-Europe for Data General Corpora- 
tion. We applaud Jack and the rest of the Com- 
modore board, and wish Mr. Finke much success in 
his new position. We hope this move portends a new 
stability in product relations with customers and 
dealers. 

A Major CAPUTE! 

Remember that annual awkwardness when you have 
to change from one year to the next? You write 
checks with the wrong year on them, etc.? COM- 
PUTE! is apparendy no exception to the year-end 
transition oops. Our January issue proudly claimed it 
was 1980. Hopefully the cover on this one matches. 
And, oh yes. . .missile is not spelled missle. I don't 
suppose we could claim we wanted to see if you were 
on your toesV 

A Beginners 
Guide To 
COiVIPUTE! 

If you're just getting started with your computer 
or with COMPUTE!, here are several notes to 
help you use COMPUTE!: 

Organization 

The front section of the magazine contains ar- 
ticles of general interest. These will vary from 
issue to issue with columns, business applica- 
tions articles, general programming hints and 
educational articles. While an article may ap- 
pear in this section that is machine specific, it's 
generally here because it has material of interest 
to other readers. 

The balance of the magazine is organized 
into five Gazettes. These are, in order of ap- 
pearance, Atari, OSI, Pet, and the Single- 
Boards (Aim, KYM, and SYM). Even if you're 
not the owner or user of a computer covered by 
a particular Gazette, you'll still find useful in- 
formation there. 



Presentation 

In every issue we try to present a balanced 
group of articles ranging from material for 
beginners to material for old hands. Frequently, 
a beginner can get a great deal out of an ad- 
vanced article, even though much of it may be 
over his or her head. 

Program listings are presented as legibly as 
possible. Pet programs are generally reproduced 
and reformatted here where we've developed 
software to "translate" the special Pet graphics 
characters into characters printable by our 
equipment. These are explained below: 



Program Listings for COMPUTE 

Cursor control characters will appear in source listings 
as shown below: 

il=HOME , R^CLEAR SCREEN 

^=DOWN CURSOR , T=UP CURSOR 

>=RIGHT CURSOR, ■<=LEFT CURSOR 

I.=REVERSE , r=REVERSE OFF 

Graphics (i.e. shifted) characters will appear as the 
unshifted alphanumeric character with an underline. 
This does not apply to the cursor control characters. 
The Spinwriter thimble doesn't have a backarrow 
symbol, so a "■"" is used instead. 

The "-i" is used to indicate the beginning of a 
continuation line. It is also used to indicate the end 
of a line which ends with a space. This prevents any 
spaces from being hidden. 



If, for example, you're an Apple owner using a 
Pet program that's reproduced in this fashion, 
you'll need to be familiar with these special 
characters so you can program around them. As 
more computers implement versions of 
MicroSoft BASIC, the programs should become 
more and more transportable, 

Ihe Readers Feedbaeic 
and CAPUTE! 

These two continuing features provide channels 
of communication with readers and authors. 

Tt>e Readers Feedbacic grows out of your 

comments provided via TtlO Editor's Feed" 

bacic card. You'll find one bound into every 
issue. Please use it, CAPUTE! is our collection 
ground for past errors and omissions. Here 
you'll find updates to previous program 
problems, etc. 



COMPUTE! 



Febfuorv. 1931 issue 9 



The Reader's 
Feedback 

Robert Lock and Readers 

Our best article vote will take a one month sab- 
batical. Now that we're monthly, we're adding an 
extra month for vote gathering. 

Why We're Here 

The Reader's Feedback serves several purposes. The 
principal one is self-explanatory. I read every 
Editor's Feedback card that comes in, and your com- 
ments help me in defining/refming the direction and 
goals of the magazine. 

We use the feedback as a means of showing 
authors and potential authors what kinds of material 
we're looking for. Frequently you as a reader, or as 
a group of readers, arc quite precise at defining 
needs. 

The Feedback cards are also a means of cluing 
me in on problems with vendors, problems with 
hardware and software, and specifically problems 
with any of our advertisers. Although we can't look 
into every possible problem, we do use the Feedback 
cards to show us potential problem areas. Our 
measure of this is generally quantity of responses. 

Keep writing, and we'll keep reading. Thanks 
for your continued support. From our end we'll try 
to remain the best resource magazine around. 

And Now Our Readers 

/ am a high school science teacher. I am a novice Apple 
Computer program jner. I would appreciate COMPUTE! ar- 
ticles designed to enhance ihe programming ability of novice 
Apple programmers . . . In-depth articles of Apple Poking, 
Peeking and Calls would be very helpful. . . 
We are constantly looking for good material oriented 
at beginning and intermediate programmers. 
Tutorial articles are especially welcomed. I know 
there are experienced Apple programmers out there 
that could write the kinds of articles, short program- 
ming notes, and such that our reader above is talking 
about. Well group? 

I'd like to see more articles on larger OSI Systems. 
As with the Apple reader above, we're always look- 
ing for good OSI material. Educational and business 
users should remember that their applications articles 
can help other readers, even if they don't share a 
common machine. An article describing the method 
of developing a specific applications program can be 
of as much use to others as the speciiic program 
itself. 

/ have had an Atari for six months and if it ivasn 't for the 
computer magazines I would still be trying to count votes, 
etc. or measure a bicycle wheel. . . I bought a computer to ex- 



pand knowledge and not play games. Why don 't the software 
people realize this — if it wasn't for your writers I would 
feel I had a white elephant with 1 leg. 
We try to present a mix of material in every issue 
that will be of use to our broad range of consumers 
of computers. Thus, an article on Player Missile 
Graphics, while immediately relevant to its title, is 
relevant to programmers developing applications pro- 
grams that can become more useful by unplemcnting 
these concepts. Atari is slowly releasing a business 
oriented applications library, and other vendors are 
getting involved as well. We would certainly like to 
see more applications programs submhted here. 

A Call For Generality 

In reflecting on the now final mix of this issue, I 
realize (as always) a few things to change next time 
around. The article on the line-oriented text editor is 
discussed for both Apple and PET. The program 
presented is for PET, with the author comment that 
the Apple version requires only I/O changes. The ar- 
ticle wasn't supplied to us with (hose changes, and 
by the time I realized it, it was too late to get 
them ... or to hold the article back. If you send us an 
article that's applicable to more than one 6502 
machine (and that's the kind of article we dearly love 
to get), please make sure you include the \'ersions for 
the various machines. 

If you translate a program written for one 
machine in COMPUTE! so that it will run on your 
(different) machine, send it in. It helps make the 
magazine more useful for all readers. We don't have 
the programming staff here to do it automatically, 
but with thousands of programmers out there reading 
the magazine, I'm sure some of you must be 
translating. 

Until next time... © 



Keep Those Cards 

and Letters 

Coming 

COMPUTE! 

Needs You! 



Address articles, programming notes 
and comments to: 

The Editor 

COMPUTE! 

P.O. Box 5406 

Greensboro, NC 27403 



Februarv. 19S1. Issue 9 



COMPUTE! 




ENGINEERING SOFTWARE FROM 
THE ENGINEERING PEOPLE. 



For more than 30 years, engineers and 
technicians hove relied on Sams technical, 
electronics, and computer books, Now, Sams 
has put its technical expertise together in a 
complete series of circuit design software 
programs, 

7 packages encompass 37 different pretested, 
debugged programs. Fully documented. Easy 
to use. Available on tape or disk for popular 
microcomputers. Multi-program tapes oniy 
$24,95,,, disks $29,95. 

Sams Software helps you optimize your circuit 
design by letting you quickly look at all the 
design parameters and possibilities. Sams 
Software is the fastest way to solve 
complicated, repetitive engineering, 
mathematical, and statistical problems that 
use up creative engineering time and rob you 
of engineering freedom. 

Sams Software is the difference between static 
and dynamic designing. If you're still trying to 
compete in today's world with old-fashioned 
techniques, catch-up with the future. Find out 
how Sams Circuit Design Software can 
change your ideas into working designs faster, 



Mail the coupon today for a copy of the Sams 
Software Catalog . , , or call toll-free for the 
name of your nearest Sams Software outlet — 
1-800-428-3696. 



r. 



Howard W. Sams & Co., Inc. 
4300 West 62nd Street 
RO. Box 7092 
Indianapolis, IN 46206 

Name 



n 



Company _ 

Address 

City 



.State. 



.Zip. 



The microcomputer I currently use is: TRS-80 APPLE I 

OSI OTHER; 



hterested iniTechnicoL 



. PersonaL 



Educational Business. 



Soms 



COMPUTE! 



February, 1961. Issue 9 



Writing For 
COiVIPUTE! 

Robert Lock, Editor/Publisher 

We are always seeking good material for publication 
in COMPUTE!. I cannot overstress our interest in 
material for the beginner; in short (e.g. 1 page or so) 
programming hints; in material that crosses 
"machine boundaries". We present a mix of long ar- 
ticles and short ones. Length is not a criteria of suc- 
cess. Frequently our most favored articles have been 
simple, provocative programs. 

Remember The Beginner 

Every time an issue of COMPUTEi goes out, there 
are new readers, with new machines, trying to get 
started with documentation that may or may not 
meet their needs. That's one of the reasons we stress 
good solid introductory material. Many of our 
readers are interested in simple programming 
assistance and support. Many are interested in useful 
programs that allow them to get more practical use 
from their machines. 

Guidelines for Potential Authors 

Take a look ai The Readers Feedback column this 
time. It's devoted to reader comments on content. 
Then sit down and write up a brief article describing 
that program you've been using at home for six 
months that you think nobody else would be in- 
terested in. You might be surprised. 

Submitting Articles To COMPUTE! 

Manuscripts should be double spaced, typed with 
both upper and lower case (please!). Program listings 
should be pro%'ided in printer output form as well as 
machine readable form. If you don't have a printer, 
that shouldn't stop you from submitting an article. 
I'm sure your local store or a friend would be more 
than happy to let you run off a listing for COM- 
PUTE! If that isn't feasible, send it anyway. Many 
excellent articles don't even contain programs. 
Address your articles to: 

The Editor 

COMPUTE! Magazine 
P.O. Box 5406 
Greensboro, NC 27403 USA 

The Foiiow-Up 

We pay for accepted articles based on their number 
of pages in the magazine. You'll receive payment 
after the article appears. Thanks to you all for 
writing for COMPUTE! - 




CURE TO 

SOFTWARE 

PROBLEMS 



PROFESSIONAL SOFTWARE 

Medical, Dental & Legal Systems, 
Accounting & Financial, Educational, 
Word Processing, Office Management 

Check your Local Dealer or Contact: 

Chorle/ fllQAfi £ A//ociole/ 

7594 San Remo Trail 

Yucca Valley, Ca. 92284 

(714) 365-9718 



Apple II 



TRS-80 



Tl 99/4 




Model EP-2A-87 

EPROM Programmer 



'o-'TiiiAirTr '^^^ ^°'^^' EP-2A-87 

g. ^wifotoni, ..._ 1 EPROM Programmer has an 
RS-232 compatible interface 
and includes a 2K or 4K 
buffer. During the ONLINE 
mode, another computer 
can down-load to the buffer. 
Only two easj^-to-imp!ement 
commands are available to 
an external computer. (Load 
buffer and read buffer.) 

In the OFF-LINE mode, the EP-2A-87 will program, verify, test 
buffer, and load the buffer from the EPROM socket. During the 
programming cycle, the EPROM is checked before programming to 
insure that it is erased and after programming it automatically verifies 
that programming is correct. Power requirements are 115 VAC 
50/60 Idertz at 15 watts. 

Part No. De&cription Price 

EP2A87 1 Programmervi-.lhZK buffer ., iSV.'i.fm 

EP2A-872 Programmer wih4K buffer ten.lKl 

Non5landardrallageDpnon(22lK. 24(1 i.. 100 v) 15.IKI 

PM n Pcrsonahlv Mo-dule. prosrams TMS 2708 IS.OO 

PM 1 Pi?r5onalin,' module. prCKJrJims 27IW 18.(*1 

PM2 Pcrsonahtv' module, programs 27.12 :MIX1 

PM 3 Personalilvfmodule. programs TMS 2716 2tUM> 

PM4 Pensonalirv module, programs TMS 2532 :M()(I 

PM.=J Personaliry module, programs 2716. TMS 2516 18(10 

PM-6 Personalitv- module, programs 27M 1S.0(1 

PM7 Personality module, programs 275S.TWS 2508 181X1 

PMS Personality module, programs Motorola MCM6a764 X>m 

Optimal Technology, Inc. 

*^ Blue Wood 127 

Earlysvitle, Virginia 22936 
Phone (804) 973-5482 



febtuorv. 1981. Issue 9- 



COMPUTE! 



w 





Jim MicfoSyslcms. Inc 

WordPro 15 a Iratlemark d1 Prolessional 

Sotiware. Inc 



"This module 
is much more 
powerful than 
you can 
imagine." 

Robert Baker, 
February, '81 KILOBAUD 

With WORDPROPACK, 
JINSAM's WORDPRO 
interface, you obtain 
the ultimate "state of 
the art" business tool. 
And, WORDPROPACK 
is just one of seven ac- 
cessory nnodules and 
systems available with 
JINSAM Data Manager. 

JINSAM is Commodore 
approved. JINSAM is 
available for all Com- 
modore 32K microcom- 
puters. 



Send only $15 for your 

own 84K 5 program 

demonstration system 

or 

SEE YOUR NEAREST 

COMMODORE DEALER 

FOR A DEMONSTRATION 

JINI MICRO- 
SYSTEMS, INC. 

P.O. Box 274 • Riverdale, N.Y. 10463 
PHONE: (212) 796-6200 




The ATARI® Tutorial 

Ca^PUTEfl 

Calligraphy? 

Well, not reallyi But with the FONTEDIT program tn IRIDIS #2 
you can design your own cfiaracter sets (or fonts) for the 
ATARI, For example, you can create a Russian alphabet, or 
APL ctiaracters, or even special-purpose graptiics symbols. 
These special tonts can be saved on disk or tape for later use 
by your programs. FONTEDIT is a friendly, easy-to-use 
program: Just grab a joystick and start designing. 



'ONTEDIT' 



FONTEDIT 



/■I J \ /,"■ /7 



With our KNOTWORK program, you can design patterns of 
Celtic interlace, (a technique used by 7th century Irish monks 
to illuminate manuscripts). After you have produced a pretty 
pattern on the screen of your ATARI, you can save it on disk or 
tape. As you might expect. KNOTWORK uses custom graphics 
characters that were created with FONTEDIT. 




FONTEDITand KNOTWORK are available now in IRIDIS 
#2. the second of our ATARI tutorial progrann packages. 
You ge! a C-30 cassette or an AJAR I diskette wit hour 
excellent programs ready to load into you rATARI. Best of 
all, IRIDIS #2 comes witli a 48-page User's Guide, which 
gives clear instructions on how to use tine programs.The 
Guide also provides detailed, line-by-line descriptions 
of how the programs work. (IRIDIS programs are written to 
be studied as well as used.) Our Hacker's Delight column 
important PEEK and POKE locations in explains many 
your ATARI. 

The User's Guide also includes Novice Notes for the 
absolute beginner. We don't talk down to you, but we do 
remember how it feels to be awash in a sea of bytes 
and bits and other technical jargon. If you are new to 
programming, IRIDIS is one of the easiest ways you can 
learn how to get themost out of your ATARI. If you are an 
old hand, you'll be delighted by the technical excellence 
of our programs. (We are the people who have published 
CURSOR for the Commodore PET since July, 1978.) 

ATAHl .^ a JiaO'Smarbi of ATARI inc 



ORDER FORM 



IRLDtS 1(2 - Foni«dll and Knotwor^ 



IRtDI'S "1 - Clock. Z*p. Logo, Polygon* 

a 19,95 C»*«t1# a SI 2.95 D(lh 



snpd By j}^p Code 



Puon 

B«x56« Works 

Go^eta. CA 93116 

805-683-1585 

Dealer Inquiries Invited. 



D V>M U MC Card No 
Ei[»re« 



_ Stgnaiure . 



ifllDlS reoiiires l6*t fO( c^^^eile Z-Hi 'or disk 



10 



COMPUTE! 



Februory, 1981 Issue 9. 



INVENTORY 
CONTROL 

FOR THE COMMODORE 32K 
COMPUTER SYSTEM 



1250 Items Per Disk. (2040 Disk) 

Tracks Sales Figures By Manufacturer. fii 

Computes Standard Markup Or Percentage Based 
On Selling Price, i ' M ii 

Generates Over/Under Stock Reports. 
Generates A Physical Inventory Report In 
Location Sequencoj | j jj 

Fast Random Access File Structure Allows Any 
Record To Be Displayed On The Screen In Under 
One Second For Changing Or Deleting. 
Generates Daily Sales Report, Retail Price List, 
And MTD/YTD Sales Reports. 
Many Other Features Found Only In Large 
Mainframe Inventory Control Systems. 




SEE YOUR NEAREST COMMODORE DEALER FOR A DEMONSTRATION 

CMS Software Systems, inc. 

5115 MENEFEE DRIVE • DALLAS, TX 75227 • 214-381-0690 



February. 1931. Issue 9 



COMPUTE! 



MAILING 
LIST MANAGER 

FOR THE COMMODORE 32K 
COMPUTER SYSTEM 



1340 Records Per Disk. (2040 Disk) 
Prints Labels One Up, Two Up, Three Up, Four Up 
Or Tine Same Label Two Across, Tliree Across, Or 
Four Across. 

Fast l\/!achine Language Sorting Of File By 
Company Name, Customer Name, City, State, Or 
Zip Code Pius Secondary Sorting Witliin Any Field 
Sucli As Company Name Witliin State. ^^^ 

Record Selection Code Allows Printing Of Sub- 
Files Within Master File. P^ 

Can Be Used With Word Pro 3/4 For Printing Form 
Letters, Etc. '^ 

Fast Random Access File Structure Allows Any 
Record To Be Displayed On The Screen In Under 
One Second For Changing Or Deleting, ^^^i^^m. 




SEE YOUR NEAREST COMMODORE DEALER FOR A DEMONSTRATION 

CMS Software Systems, Inc. 



5115 MENEFEE DRIVE • DALLAS, TX 75227 • 214-381-0690 



COMPUTE! 



Februarv, 1981 Issue 9. 



Guest Commentary 

BUSINESS 
APPLICATIONS 
ANALYSIS--THE 
MISSING STEP 

Editor's Nolf: I'his article, iirifiinally printtd in the July/August, 1980 
COMPIJI E!, is rejmntrH became of iti lacfulnca. 



Hal Wodlesgh 

Business applications analysis seems to be the nnost 
neglected element of ifu; microcomputer industry 
today. The shame of it is that the principles of 
business analysis affect almost every phase of the use 
of microcomputers in the business environmcnt--from 
the initial choice of equipment to evaluating programs 
in use. The root ol the problem appears (o lie in 
the history of microcomputer software. 

A short time ago, there was little or no business 
software available for the smaller microcomputer 
systems. The software market was flooded with games, 
but programs that do anything useful for businesses 
were few and far between. When business programs 
could be found, they were unfortunately lacking in 
the qualities that make "good" software distinct 
from "bad" software. Now that the systems have been 
out for a while, the quantity of business j)ackages 
available is greatly improved. The bad news is that 
the quality of this software (with a few notable 
exceptions) is as poor as ever. 

Both of these situations— the plethora of games and 
the low quality of business softvvare--sccm to be related 
to the way in which most microcomputer programs 
are developed. The programmer gets an idea and sits 
down to start coding. This approach is ideal for 
games because any interesting oddities that occur 
dining this rather non-objective procedure can be 
incor[)orated into the game to make it more interesting. 
This is also the worst procedure possible for business 
programming. 

The nature of games is that they don't have to 
do anything in particular (except hold the player's 
interest) and the job itself can be redefined to 
accommodate any discoveries made during the program- 
ming process. In this casC; the program is more 
important than the job it is suppo-sed to do! 



Business programs, however, are the exact 
opposite--the job is everything and elegant pro- 
gramining is almost meaningless. A good business 
program is one that does the job well. A bad 
business program is one that does the job poorly. 
The elegance and sophistication of the program does 
not matter. Successful games are usually programs 
that continually surprise and amaze t!ie user. Business 
progranis had better NOT surprise and ama/.e the 
user. 

The jjrinciples of business applications analysis 
arc really quite simple. It docs not take a great 
deal of intelligence or education--just a little control. 
It is a five step piocess: 

STEP #1: Define The Job 

It is not too unusual to hear a small businessman 
say something like "I bought one of those little 
computers last year. What do you think I ought to do 
with ii." It's a rather amazing statement when you 
think aljout it. The man has a tool and would like to 
know what kind of job to dc) with it. The proper 
procedure is to buy the tool that best fits the job 
that needs to be done--it doesn't matter if we're 
talking about hammers or computers. 

Any computer is a tool for processing informa- 
tion. Defining the job for a computer is usually 
a simple matter of completing the sentence "I 
want to get. . ." with a detailed description oi 
what will be the output of the system. 

This step is often called the OUITUT SPECI- 
FICATION phdst. 

STEP #2: Define The Information Necessary 
To Do The Job 

No cfjmputer will create new information. A computer 
will, however, change the form of information that 
is available to it into a more useful form. I'ot 
example, a file available to the computer might have 
a lot of records on items in a business' inventory. 
Each one of these items has the information on what 
the value of the items are individually and a count 
of how many of these items are in stock. The computer 
can, whenever necessary, take these individual items 
of information and produce that information in the 
form of a statement that, "Current inventory is worth 
$9875.42" on a display. This is not really a matter 
of producing new information--since the information is 
already contained in the individual inventory items. 
The computer has simply changed the form of that 
information into something more desirable. 

Since we have already defined the job we want 
the computer to do, we now have to define the 
information that the computer will need to do that 
job. This often involves a bit of research. The 
person who does this part of the anlysis has to know 
how to do the job itself. It also usually involves 



February. 1981 Issue 9. 



COMPUTE! 



THIS YEAR . . . 

DO IT THE EASY WA Y! 




...for the SERIOUS Apple H User 



1981 TAX PREPARER by Howardsoft 



(COMPUTER-AIDED TAX EILIMG & RECORD-KEEPING) 

EASY-TO-USE 



Sfl/'-lilsiniciiiii; \\ilh huiil-in sample ri'itim • Prompted hy </iH'siio>is & menus* On-screen prepara- 
lion uses facsimile of IRS forms • Easily creawd iiemized lists ivWi sums computed & entered on 
proper lines • FulH'eaiure editing of all data • Error-tulerani disk filing for relrievtil & updating. 



TIME - SAVING 



-1 // math & linking of form.', performed automatically • Changes in one form automatically reflected 
ill all others • Reenter preparation at any point • Once data entered & editini; complete, computer 
produces complete printout of forms, schedules, itemized lists • File forms directly with the IRS. 



Year-lonx record-keepin!> makes year-end tax filing easy • Interne five & on-line, no prior organizing 
r* M \/ F M I F N T neces.'iury* I'se^cith or without line printer* So special printer or paper* Creates own facsimile of 



necessary 
IRS forms ' 



Paginated hIiIi lRS-t\pe header • Fully compatible with all line printer. 



All .schedules (.A.B.C. D.E.F.G. R&RP.SE. TC) and many forms (11)40.2210. 2in6.i46H.4562.47:6. 
4T)7. Jrti'JJ • Low-cost annual updates to stay current wtih new tax laws • Designed for future 
expansion to include additional forms • Full dociimentatiim and instructions in liand.w/ne notebook 

.Alternative tax strategies easily compared • Special handling of gain/ loss, depreciation, rental 
income • .411 files coded for use hy multiple taxpayers • Used hy tax profe.ssionalsfor numerous 
clients • Extra features when used with 2 disk drives * .411 tax rate schedules are huilt in. 



COMPLETE 
SOPHISTICATED 

A VAILABLE NOW for Apple Computers with 48K, Applesoft ROM, & 1 or 2 disk drives . . . $99 

(Inquire at your dealer or order direct. »'e pay shipping "•? prepaid orders. 
Alt others sent C.O.D. with handling charges added. California residents add 6'"c sales ta.x.) 

Also ask about our Real Estate Analyzer & Creative Financing packages. 



Howard Software Services 



7722 Hosford A venue 

Los Angeles, CA 90045 

(213) 645-4069 



14 



COMPUTE! 



February. 1981, issue 9. 



finding out the exact form tlic information is in when 
it becomes available to the people who will be 
operating the computer. 

This step is often called the INPUT SPECIFICA- 
TION phase. 

STEP #3: Define The [nformation To Be Stored 

Some of the information necessary to do the job 
will be needed over and over again. It is silly and 
wasteful to require operators to enter this information 
every time it is needed. Sometimes the job itself is 
simple data retrieval-dooking at stored inibrmation. 
This is the step where the information that should be 
stored is defined. In this step, you decide the number of 
data files, the form of each data record in the file, 
and even the size of the file, 

This step is often called the FILE SPECIFICATION 
phase. 

STEP #4: Determine The Physical Flow Of The 
Information 

Business applications are a matter of getting the 
right information to the right place at the right time. 
If the computer is going to be printing reports in 
the accounting office and the information is needed 
at the loading dock, then the system specifications 
have to include a means of getting that printed report 
to the loading dock. This step will be almost meaning- 
less in some applications--but it will be the most 
critical step in others. In either case, it cannot be 
ignored-even if it seems to be unimportant at first 
glance. 

This step is often called the WORKFLOW SPECIFI- 
CATION phasft. 

STEP #5: Define The Time Contraints Of The 
Operation 

Since we are dealing with a system that has to get 
the right information to the right place at the right 
time, we need to make some rather exact definitions 
of the tolerable delays for each step of the job. It 
would be silly to define a system that has to sort 
large files in many different ways without allowing 
enough time for these sorting operations. It would also 
be silly to try to function without such sorting 
operations if they arc critical to the operation itself. 
This final step is often called the RESPONSE TIME 
SPECIFICATION PHASE. 

This constraints defined in this stage may show 
that the previous steps have resulted in a system 
design that simply cannot work fast enough to do the 
job. This could necessitate doing one or more of the 
earlier steps over until all five .steps conclude with 
a acceptable applications design. 

The Final Result-System Specifications 

Now that you have completed these five steps, you 
have some idea of what you are looking for. You 



still haven't chosen any equipment and you haven't 
even designed any programs--bui you 130 have a 
complete definition of the exact job to be done-- 
and that is the most critical point: 

YOU CANNOT BUY AND PROGRAM A COMPUTER 
TO DO A JOB UNLESS YOU KNOW E.XACTLY 
WHAT THE JOB IS!!!! 

Unless you have gone through this process, you don't 
really know what the job is and you can't really make 
any informed decisions about equipnicnt or program- 
ming. The end results are all too often cither comical 
or tragic. 

The general impression of many computer pro- 
fessionals is that micro systems are toys and that 
micro software i,s limited to games and junk. There 
is an uncomfortable amount of truth to that view-- 
due to the haphazard way in which micros have been 
u.scd. If people in the microcomputer industry begin 
using their tools properly, that attitude will change. 
It will soon become obvious that mainframe systems 
arc needlessly expensive behemoths and that main- 
frame software is archaic and oversensitive to small 
errors. 

The real microcomputer revolution will begin 
when microcomputers are used properly-and defining 
the job to be done is always the first step to proper 
use. © 



Apple Disk Fixer 




APPLE 

32K, DISK 



13 OR 16 SECTOR 



II you care enough to back up critical programs and tiles, Disk 
Fixer' "will give additional peace of mind. This powerful utility 
for experienced Apple users is a tool kit for manipulating, repair- 
ing, and protecting all data on disk. . 

Use the high-speed full screen editor to examine and easily 
change any portion o( a disk, correct space usage within files, 
and save money l)y locking out bad tracks on disks. Directories 
are alphabetized, if you choose. 

The display and search capabilities show where specific HEX 
or ASCII data is located and you can modify any data including 
binary files. dos 3.2, dos 3.3 & language system disk 

Wrillen by Jsltny P. Gaijiers 
©1S80 Tiia Image Producers, Inc., All Rights Raitmed 



COMPUTK 
PRODUCTS™ 



615 Academy Drive 
Nwthbrook, IL 60062 
31!(564.5060 



Februory. 1981, Issue 9, 



COMPUTE! 



15 



MICROCOMPUTER 
INDUSTRIES, LTD. 



WORDCHECK 

WordCheck is the secretary's lifesaver! 

Our newest and already one of our fastest 
selling programs. 

This program interacts with WordPro 3 or 
4*. Run your letters and documents through 
WordCheck it checks EVERY SINGLE WORD 
for spelling or typographical errors. 

WordCheck contains a spelling list of most 
commonly used words. Any words that do not 
match this list will show up on your screen. If 
these flagged words are all right pass them by 
with the pressing of a single key or 
AUTOMATICALLY add them to the spelling list 
without having to retype them. 

WordCheck is ideal for doctors, lawyers 
and anyone else doing technical writing. Word- 
Check is so simple to learn to use your 
secretary can be working with it in a matter of 
minutes. 

Your worries are over! Mo more scrambling 
for the dictionary when you have to write 
"fluorescent", "nucleotide" or "receive". Word- 
Check does the work for you quickly, 
thoroughly and accurately. 

Available for CBM and PET 32K** 
machines with dual disk drives. List price is on- 
ly $200,00. 

* Word Pro is a registered trademark of Profes- 
sional Software Inc. and Pro-Micro Software Ltd. 
** CBM and PET are registered trademarks of 
Commodore Business Machines. 

INVENTORY CONTROL 

Disk based for CBM or PET 32K 

Inventory, Point of Sale, Accounts Receivable 

Inventory a minimum of 2000 items per 
diskette (a lot more with the 8050 Disk Drive.) 

Complete records of merchandise purchas- 
ed and sold. Update files and supply cost values 
of stocked items. 

Update cash and credit sales, write in- 
voices, remove sales from inventory and keep 
running total of sales tax. Cash sales and credit 
sales. 

Maintain a complete record of items 
charged, payments on account, print bills, sort 
fiels and print out summary reports. 
List price is only $200.00. 

MICRO COMPUTER 
INDUSTRIES, LTD. 

1520 East Mulberry Suitel70 

Fort Collins, Colorado 80524 

1-303-221-1955 



CREATE-A-BASE 

This data base management program for CBM 
or PET 32K handles most business data pro- 
cessing chores with one program. No computer 
experience required. Just turn it on and go! 
EXTREMELY FLEXIBLE FEATURES 

Create records with up to 24 fields of data of 

your choosing. 

File up to 650 records on each floppy diskette 

(1800 if you own the 8050 Disk Drive.) 

Change or add fields at any time. 

Change data disks with out dumping operating 

program. 

Sort or search by any one or two fields. 

Data can be added as $ amounts, with right 

hand justification. 

Perform arithmetic operations on fields with $ 

amounts ( + ,-,*,/). 

Merge files, change or scratch records, output 

mailing labels. 

Completely interactive with WordPro 3 or 4*, 

output form letters, mailing lists, accounts 

receivable, invoices, statements, inventories, 

even reports on your favorite fishing holes (and 

have more time to go fishing too.) 

Start the new year off right with Create-A-Base. 

You'll pat yourself on the back for months. 

Create-A-Base runs on CBM 8032 or 2001 32K 

machines. 

Available on disk only 

Price $200.00 For the 8050 Disk Drive $300.00 

PET-TERM 

ONLINE TERMINAL SOFTWARE FOR 

THE 8010 OR TNW MODEM 

Proven tested software for the PET 8010 
MODEM 

Machine language routines for speedy perfor- 
mance. 

All necessary screen and keyboard character 
conversions. Control key and special key func- 
tions. 

Terminal to Disk Storage. 
Sequential or Program file transmission 
capability. 

Return to BASIC at will. Operate Half or Full Duplex. 
EXTRAS 

Support programs, such as a SEQ FILE READ/ 
EDIT/PRINTER which allows you and your 
customers to read, edit and printout those data 
files you will be receiving from the SOURCE 
and other such data bases. 
This program and complete operating 
documentation lists for only $35.00. 



16 



COMPUTE! 



Febtuorv. 1981 issue 9, 



LED 

A Line-Oriented 
Text Editor 

Arp|jf3 I OO 

ABACUS SOFWVARE 

A compiler, unlike the BASIC interpreter in your 
personal computer converts program source 
statements written in an English-like language, into a 
format acceptable for execution by your computer. 
This article deals not with compilers, but with a 
general purpose utility that is used to create and 
maintain the program source language statements 
that are input to compilers. 

While designing the TINY PASCAL System for 
the PET and APPLE II it became apparent very ear- 
ly in the development stage that we would need a 
utility program to maintain the PASCAL source 
language statements. The utility we wrote for this 
purpose is called the LINE EDITOR (LED). 

The LED is line-oriented as opposed to word- 
oriented. As such, it cannot be considered a true 
word processor although it does provide many of the 
same capabilities as many of the other commercially 
available word processors. In fact, a slightly modified 
version of the LED was used to create this article. 
Although we wrote the LED to maintain program 
source statements, its usefulness is by no means 
limited to that application. 

The LED is a line oriented text editor. The en- 
tire source program must be in memory while the 
user is modifying it. Modifications allowed include 
appending source to the end of the text, inserting 
lines of text into the middle of existing text, changing 
occurance of a character string to another string, and 
printing the text to a hardcopy device. After creating 
or modifying the text, the user may then save it onto 
tape or diskette. Some of the key points to note when 
using the LED are: 

each line is numbered 
each line can contain up to 80 characters 
when entering 3 line, the line must be terminated by 

RETURN key 
a maximum of 500 lines of text may be entered (this is 

subject to the memory capacity of your particular 

computer) 
as lines arc inserted or deleted from the source program, the 

remaining lines arc automatically renumbered 
a line of source may extend more than one screen line on 

your crt 

Commands 

The following arc the descriptions of each of the 

commands: 

'F' enter FILER portion of LED 

This command allows you to use the LOAD or 
SAVE commands which arc described below: 



'L' load file from tape or diskette 
This command allows you to load a previously 
edited source program. The source program 
may have been saved on tape or diskette. 
After keying 'L' the LED will prompt you for 
the name of the source program. Key in the 
filename and depress RETURN. Do not key in 
the suffix '.SOURCE'. If you decide that you 
really don't want to load a file, then enter a 
null line instead of a filename. At this point you 
will be asked if the file was saved on tape or 
diskette (for the PET version of LED). Type 
'T' or 'D' as appropriate. If the source program 
is on tape, then you must put the source file 
tape into cassette #1. For either tape or diskette, 
the filename that is keyed in must match the 
filename that is on the storage medium. 
'S' save file onto tape or diskette 

This command allows you to save the current 
source program onto tape or diskette. 
After keying 'S', the LED will prompt you for 
the name of the file to be saved. Key in the file- 
name and then depress RETURN. The file- 
name is limited to twelve characters. The suffix 
'.SOURCE' will be added to the filename by 
the LED. If you decide that you really don't 
want to save a file, then enter a null line instead 
of a filename. 

At this point you will be asked if you want to 
save the file onto tape or diskette (for PET ver- 
sion of the LED). Type 'T' or 'D' as appro- 
priate. If the source is to be saved onto tape, 
then you must put the tape into cassette #1. 

***Note that tape is supported only in the PET 

version. 

'A' append the end of source 

This command allows you to add lines to the end 
of the current source program. If you have not 
loaded any source program, then this command 
will allow you to create a new source program. 
You may append one or as many lines as you 
desire. To signal the end of append mode press 
RETURN when the cursor is sitting at the first 
character after the line number prompt (null line). 

'C change string 

This command allows you to change an existing 
string to a new string. It will make changes to 
either a single line or to a range of lines. Indicate 
a single line by keying in its line number followed 
by RETURN. Indicate a range of lines by keying 
the line number of the first line to be searched fol- 
lowed by '-' and finally followed by the line 
number of the last line to be searched followed by 
RETURN. You will then be prompted for the 
change siring. The format for the changed string 
is: 

+ from-string + to-string + 



February. 1981. Issue 9. 



COMPUTE! 



INTRODUCING 

THE NEW IMPROVED 

BUSINESS ENHANCEMENTS 
COMPUSERVICE BUSINESS 

SOFTWARE 

FOR 

COMMODORE 

Micro Mini Computer World Inc. is an execlu- AND B E C 

APPLE 
COMPUTER 



sive distributor for the BUSINESS SOFT 
WARE developed by Business Enhance 
ments Compuservice of Escondido 
California. 



VALUE ADDED 

BENEFITS • Total commit- 
ment to the development of excellent 
business software for the 
COMMODORE and APPLE com- 



If you are selling or using the 
COMMODORE BUSINESS MACH- 
INES or the APPLE computer systems 
then vou should provide yourself and vour 
customers with the MOST COST EFFECTIVE and 
COMPREHENSIVE business software for a busi- 
ness computer system. 

CURRENT B.E.C. SOFTWARE 

• General Ledger-Master File 1000 Accounts 
and Journal File 4400 Entries 

• Accounts Receivable-Master File 1170 
Accounts and Invoice File 1430 Entries 

• Accounts Payable-Master File 1170 and 
Invoice File 1430 Entries 

• Payroll-440 P^mployees 

• Job Costing-1100 Items Per Disk 

• Inventory-1100 Items Per Disk 

• Mail List/Customer Information-1000 

Entries Per Disk 
Above figures apply to CBM 2001 computer 

system with 32K CPU and 2040 dual disk. 

With the new CBM 8050 Megabyte disk the 

volumes will be increased significantlv. 

B.E.C. SOFTWARE FEATURES: 

• Complete and total documentation 

• Step by step walk through on every pro- 
gram operation, with examples 

• Each package is MENU driven and uses 
dynamic load and overlay once the initial 
menu is loaded. 

• Examples are provided for all reports and 
other printed forms. All forms are available 

from New England Business Services Inc. (NEBS). 

• All input/output operations use random access 

• Sorts are machine language sorts 

• Programs are interactive with the General 
Ledger and update the GL automatically. 



rf->, puter systems. 

0"V7'C^'T^"|j^"JY/rO • At reasonable rates Micro Mini 
i^ X li«3 A J-JXVXK*^ Computer World Inc. will provide 
software modifications to meet customer require 
ments. (Call MMCWI for further information) 
• EXTENDED WARRANTY which entitles 
users to any enhancements to accounting 
software during the year of coverage. 
(Cost is SlOO per year) 

Dealers and Interested Parties may obtain a 
copy of the B.E.C. software documentation for 
S25. If after review you are not interested, 
send the documentation back, in re-saleable 
condition, for a full refund or apply the 
S25 toward your first software purchase. 

The NEW B.E.C. BUSINESS SOFTWARE 
requires a special ROM chip for proper 
operation. 

Suggested Retail Prices are: 

1. Rom chip S70 (required on any software 
package) 

2. Individual software package SI 50 

3. All seven software packages $995 (save 
$55) 

DEALER INQUIRIES ARE INVITED 




micro 
mini 



COMPUTER WORLD inc 




"COu^TRy SHOPPY'''' 



-t^- 



fl.i'^ 



74 ROBINWOOD AVE. 
(614) 235-5813 



COLUMBUS, OHIO 43213 
(614) 235-6058 



18 



COMPUTE' 



February, 1981, Issue 9. 



where: 

+ is a delimiter — any character may be used but it 
must not be contained in cither the i'rom-string or the 
to-string. 

from-string is the string of characters which arc to be 
rcplacecl 

to-string is the string of characters which are to 
replace the fi-om-string in the original source line 

e.g. /abc/xyz/ 

in the above example all occurances of 'abc' will be replaced 
by 'xyz'. 
e.g. /abc// 

in the above example all occurances of 'abc' will be elimi- 
nated (replaced by nulls). 

'D' delete line or range 

This command allows you to delete a line or a 

range of lines from the sotirce program in 

memory. 

DELETE range(low,high)-> 80 

will delete line 80 
DELETE range(low,high)- > 80-90 

will delete lines 80 thru 90 
DELETE rangc(low-high)-> -20 

will delete all lines thru 20 

'I' insert lines into source program 

This command will allow you to insert lines into 
the c-xisiing source program. LED will prompt 
you for the line number before which you want to 
insert the new source statements. You may enter 
one or as many new lines as you desire. Follow 
each line with RETURN. To signal the end of 
INSERT mode press RETURN when the cursor 
is setting at the first character in the line (null). 

'L' list source program 

This command allows you to list a line or range 

of lines. 

LIST range(low-high)-> 80 

will list line 80 
LIST range(low-high)-> 80-100 

will list lines 80 thru 100 
LIST rangc{low-high)-> -20 

will list all lines thru 20 
LIST range(low-high)- >" null 

will list all lines 

With the LIST command only the following features 
are available: 

PET 

RUN/STOP key - suspends (he listing awaiting the 

depression of the RETURN key. 

SPACE BAR - scrolls the listing one line at a time 

OFF/RVS key - slows the speeds of the listing 

APPLE II 

ESC key - suspends the listing awaiting the depres- 
sion of the RETURN key. 

RETURN KEY - revcri.s to luinnal speed listing 
aficr F.SC 
SPACE BAR - slows the speed of the listing 



'M' menu display 

This command allows you to sec a more complete 
explanation of the commands than the abbreviated 
version which prompts you, 

'P' print source program 

This command allows you to print a line or range 
of lines to a hardcopy printer. The PET is sup- 
ported thru the IEEE interface as device 4. The 
APPLE II is supported thru slot 2. The range 
specifications are identical as LIST. 

'Q' quit LED 

This command allows you to gracefully exit from 
the LED. The LED gives you a chance to change 
your mind so that if you accidentally keyed 'Q_', 
then you will have another opporttmity to save 
your source file. 

'R' replace a line 

This command allows you to replace a single line 
only. After keying in the line number to be re- 
placed, the LED will ])romi)t you with (hat line 
number. Key in the replacement text and press 

return, 
e.g. 

REPLACE -line#-> 108 

allows you to replace line 108 

Listing 

The listing which follows is (he version of the LED 
lor the PET/CBM machines. The version for the AP- 
PLE II is very similar (o the PET/CBM version and 
runs under APPLESOFT. The major differences bet- 
ween the (wo versions are in the routines that handle 
the disk and printer I/O. 

REM LINE EDITOR CC)1980 ABACUS -, 

-.SOFTWARE 
10 DIMT$(500) :REM BUFFER SPACE 
20 L$="":REM CURRENT LINE 
30 LL=1:REH LAST LINE # 
40 SP$=" ":DL$=CHR$(20} 

50 EE=0:REM DISK ERROR CHANNEL CLOSED 
60 PR=0:REM PRINT CHANNEL 
90 P0KE144,49:REM DISABLE STOP KEY 
100 PRINT"fi rABACUS SOFTWARE LINE -. 

-.EDITOR" 
110 PRINT"^t FUNCTIONS:" 
130 PRINT 

140 PRINTTABtS} ; "A) PPEND-TO END OF TEXT" 
150 PRINTTAB(8) ; "C) HANGE-STRING 
160 PRINTTAB(8} ; "D) ELETE LINE(S) 
170 PRINTTAB(8) ; "F) ILER COMMANDS 
180 PRINTTAB(8) ; "DNSERT BEFORE LINE 
190 PRINTTAB(8) ;"L) 1ST LINE{S) 
200 PRINTTAB(8) ;"M)ENU DISPLAY 
210 PRINTTAB(8) ;"P)RINT LINE(S) 
220 PRINTTAB{8) ; "Q) UIT LEAVE EDITOR 
230 PRINTTAB{8) ;"R)EPLACE LINE 
240 PRINT: PRINT" ENTER SELECTION-> " ; 
250 GOTO510 
500 PRINT: PRINT"j:ENTERf A, C, D, F , I , L , P, Q, 

-.R,M)ENU->"; 
510 GET A$: IFA$=""THEN510 
520 J=0:PORI=1TO10 
530 IFA$=HID$("ACDFILRMQP",I,1)THENJ=I: 

^1=10 



February. 1981 Issue 9, 



COMPUTE! 



540 NEXTI 

550 PRINTA$ 

560 IFJ=0THEN500 

570 ONJGOTO1000, 2000, 3000, 4000, 5000, 

-.6000,7000,100,8000,9000 
1000 PRINT 

1005 PRINT"xAPPENDf TO END OF TEXT" 
1010 PRINT:PRINTLL">"; 
1020 GOSUB10000:REM GO READ LINE 
1030 IFLEN(L$)=0THEN500 
1040 T5(LL)=L$ 
1050 LL=LL+1 
1060 GOTD1010 
2000 REM CHANGE STRING 
2010 PRINT: PRINT"rCHANGEr"; :GOSUB16000: 

-.REM GET RANGE 
2020 IFHI=0THEN500 
2025 PRINT"i:CHANGEr STRING-> " ; :GOSUB1000 

-.0:REM GET STRING 
2030 L=LEN(L$) 
2040 IFL=0THEN500 
2050 IFL<4THEN2000 

2060 DM$=LEFT$(L$,1) :REM DELIMITER 
2070 IFRIGHT$(L$,1}<>DM$THEN2000 
Z580 J=0:FORI=2TOL-1 
2090 IFMID$(L$,I,1)=DM$THENJ=I 
2100 NEXTI 
2110 IFJ=0THEN2000 
2120 IFJ=2THEN2000 
2130 FR$=MID${L$,2,J-2) 
2140 IFJ+1=LTHENTS$="":GOTO2160 
2150 TS$=MID$(L$,J+1,L-J-1) 
2160 F=LEN(FR$) 
2170 FORI=LOTOHI 
2180 T=LEN(T5(I) } :S=1:NL$="" 
2190 F0RJ=1T0T-F+1 

2200 IFMID$(T$(I) ,J,F) <>FR$THEN2230 
2210 NL$=NL$+HID${T$(I) ,S, J-S)+TS$ 
2220 S=J+F:J=S-1 
2230 NEXTJ 
2240 IFS<>1THENNL$=NL$+RIGHT$ (T$ ( I) , 

-.T-S+1) :T$(I)=NL$ 
2250 NEXTI 
2260 GOTO500 
3000 REM DELETE LINE(S) 
3005 PRINT :PRINT"j:DELETEr " ; :GOSUB16000 : 

-.REM GET RANGE 

3010 IPNOTDFTHEN3015 :REM NOT DEFAULT ON ■ 

-.ENTIRE FILE 

3011 PRINT"j:DELETEf ENTIRE FILE? "; 

3012 GETA$:IFA$=""THEN3012 

3013 PRINTA$:IFA$="N"THEN500 

3014 IFA$<>"Y"THEN3011 

3015 IFHI>LL-1THEN500 

3020 IFHI=LL-iTHENLL=LO:GOTO500 

3030 J=HI-L0+1 

3040 FORI=LOTOLL-J-1 

3050 T$(I)=T${I+J) 

3060 NEXTI 

3070 LL=LL-(H1-L0)-1 

3080 GOTO500 

4000 REM FILER 

4010 PRINT"^rFILERr ENTER L)OAD OR -. 

-.S)AVE~> "; 
4020 GETA$:IFA$=""THEN4020 
403 IFA$<>"L"ANDA$<>"S"THENPRINT: 

-.GOTO4000 
4040 PRINTA$:M?=A$ 
4050 PRINT"j:ENTERf FILENAME-> "; 
4070 GOSUB10000 



4075 IFLEN(L$)=0THEN500 

4076 IFLEN(LS) >12THEN4050 
4080 FIS=L$ 

4090 PRINT "jiENTERf D) ISK OR T)APE-> " ; 

4100 GETA$:IFA$=""THEN4100 

4110 PRINTA$ 

4120 IFA$<>"D"ANDA$<>"T"THEN4090 

4130 IFA$="D"THEN4160:REM DISK ROUTINES 

4140 IFM$="L"THEN4400 

4150 GOTO4200 

4160 DR$="":IFLEFT$(FI$,2) <> " : "ANDLEFT$ 

-.(FI$,2)<>"1:"THENDR$="0: " 
4170 GOTO4600 
4200 REM TAPE SAVE 
4210 IFLL=1THENPRINT"N0 FILE TO SAVE": 

-iGOTO500 
4220 0PEN2,1, 2, FI$+". SOURCE" 
4230 F0RI=1T0LL-1 
4240 F0RJ=1T0LEN(T$(I) ) 
4250 PRINT#2,MIDS(T$(I) ,J,1) ; 
4260 NEXTJ 

4270 PRINT#2,CHR$(255) ; 
4280 NEXTI 
4290 CL0SE2 

4300 PRINTSPC(6) ;FI$;" SAVED" 
4310 GOTO500 
4400 REM TAPE LOAD 
4410 OPEN2,1,0,FI$+". SOURCE" 
4430 LL=0:REM LINE COUNT 
4440 LL=LL+1:T$(LL)="" 
4450 GET#2,A$ 

4460 IFST=64THEN4500:REM END OF FILE 
4465 IFSTO0THENPRINT"*** LOAD ERROR -i 

_,***". GOTO500 
4470 IFA$=CHR$(255)THEN4440:REM END OF -. 

-.LINE 
4480 T$(LL)=T$(LL)+A$ 
4490 GOTO4450 
4500 CL0SE2 

4510 PRINTSPC(6) ;FI$;" LOADED" 
4520 LL=LL+1 
4530 GOTO500 
4600 REM DISK SAVE 
4610 IFM?="L"THEN4800 
4620 IFLL=1THENPRINT"N0 FILE TO SAVE": 

-IGOTO500 
4630 FL$="@0"+DR$+FI$+". SOURCE, S,W" 
4640 0PEN2, 8,2,FLS 
4650 GOSUB20000:REM ERROR CHECK 
4655 IFE1O0THEN500 
4660 F0RI=1T0LL-1 
4670 F0RJ=1T0LEN(T$(I) ) 
4680 PRINT#2,MID$(T$(I) ,J,1) ; 
4690 NEXTJ 

4700 PRINT#2,CHR$(255) ; 
4710 NEXTI 
4720 CL0SE2 

4730 PRINTSPC(6) ;FI$;" SAVED" 
4740 GOTO500 
4800 REM DISK LOAD 
4810 FL$=DR$+FI$+". SOURCE, S,R" 
4820 OPEN2,8,2,FL$ 
4830 GOSUB20000:REM ERROR CHECK 
4835 IFE1O0THEN500 
4840 LL=0:REH LINE COUNT 
4850 LL=LL+1:T$(LL)="" 
4860 GET#2,A$ 

4870 IFST=64THEN4500:REH END OF FILE 
4 88 IFST<>0THENGOSUB200 00:GOTO5 00 
4890 IFA$=CHR$(255)THEN4850:REM END OF i 

-.LINE 



20 



4900 
4910 
4920 
4930 
4940 
4950 
5000 
5010 

5015 
5020 
5030 
5040 
5050 
5060 
5070 
5080 
5090 
5100 
5110 
6000 
6010 

6020 
6030 

6040 
6050 

6060 
6070 
6080 

6090 
6100 
6110 
6120 
6130 
7000 
7010 

7020 
7030 
7040 
7050 
7060 
7070 
8000 
8010 

8020 
8030 
8040 
8050 
8060 

8070 
8080 
9000 
9010 
9020 

9030 
9040 
9050 
9060 
9070 
9080 

9090 
9100 



T$(LL)=T$(LL)+A$ 

GOTO4860 

CL0SE2 

PRINTSPC(6) ,-FI$;" LOADED" 

LL=LL+1 

GOTO500 

REM INSERT LINE 

PRINT:PRINT"xINSBRTr BEFORE ";: 

nGOSUBl7000:REM GET LINE# 
IFLO>LLORLO<1THEN5000 
PRINT :PRINTLO; " > " ; 
GOSUB10000:REH READ LINE 
IFLEN(L$)=0THEN500 
LL=LL+1 

F0RI=LLT0L0STEP-1 
T$(I)=TS(I-1) 
NEXTI 
T$(LO)=L$ 
LO=LO+1 
GOTO5020 
REM LIST LINES 
PRINT: PRINT "rLISTr " ; :GOSUB16000: 

-.REM GET RANGE 
IFHI:-0THEN500 
SS$= "N" : PRINT : PORI=LOTOHI :REM -. 

-.PERFORM LIST 
PRINTI; ">";T$(I) 
GETA$ : IFAS=CHR$ (18 ) THENFORJ=1TO1024 

-.:NEXTJ 
IFA$<>CHRS(3)THEN6110 
SSS="Y" 

GETA$ : IFA$=CHR$ ( 13 ) THENSS$= "N" : 

•nGOTO6110 
IFAS<>CHR${32)THEN6070 
GOTO612 

IFSS?="Y"THEN6070 
NEXTI 
GOTO500 

REM REPLACE LINE 
PRINT :PRINT"rREPLACEr " ; :GOSUB17000 

^:REM GET LINE# 
IFLO>=LLORLO<1THEN70 
PRINT : PRINTLO; ">"; 
GOSUB10000:REH READ LINE 
IFLEN(L$}=0THEN500 
T${LO)=L$ 
GOTO500 
REM QUIT 
PRINT: PRINT" xLEAVE EDITOR-ARE - 

-.YOU SURE?r "; 
GETAS; IFA$=""THEN8020 
PRINTA$ 

IFA$<>"Y"ANDA$<>"N"THEN8000 
IFA$="N"THEN500 



PRINT: PRINT" 



END LINE 



-.EDITOR **r" 
P0KE144,46:REM ENABLE STOP KEY 
END 

REM PRINT LINE 
IFPR=0THENPR=4 : OPENPR, PR 
PRINT"j:PRINTr "; :GOSUB16000: 

-.REM GET RANGE 
IFHI=0THEN500 

FORI=LOTOHI:REM PERFORM PRINT 
PRINT#PR,I;": ";T$(I) 
NEXTI 
PRINT#PR 
PRINT#PR,"***";LL-1; "LINES IN - 

-.BUFFER ***" 
PRINT#PR 
GOTO500 



COMPUTE! 


February, 19B1. Issue 9 


10000 


REM INPUT A LINE OF TEXT 


10010 


L$="" 


10020 


PRINT"i<"; 


10030 


GETA$:IFA$=""THEN10030 


10040 


1FA$=CHRS(13)THENPRINT" ": RETURN 


10050 


IFLEN(L$) >80THENGOTO15000 


10060 


IFA$>=SP$ANDA$<=CHR$(95)THEN10100 


10065 


IFA5>=CHR$ (161 ) ANDA$<=CHR$ ( 223 ) THE 




-.N10100 


10070 


IFA$<>DLSTHENGOTO10030 


10080 


IFLEN{L$) >0THENPRINTA$; ;L$=LEFT$(L 




-.$,LEN(L$)-1) 


10090 


GOTO10020 


10100 


LS=L$+AS:PRINTA$; :GOTO10020 


15000 


REM LINE INPUT ERROR 


15010 


PRINT :PRINT"j:ERRORr LINE TRUNCATED 

II 


15020 


~l 

RETURN 


16000 


PRINT"RANGE(LQW,HIGH)-> " ; 


16010 


GOSUB10000:REM INPUT RANGE 


16020 


L0=1:HI=LL-1:REM DEFAULT LIST ALL 


16025 


L=LEN(L$) 


16030 


DP=0: IFL=0THENDF=-1 :GOTO16150 


16040 


J=0:FORI=1TOL 


16050 


AS=MIDS(L$,I,1) 


16060 


IFA$>="0"ANDA$<="9"THEN16090 


16070 


IFA$="-"THENJ=I:GOTO1609 


16080 


J=99:I=99 


16090 


NEXTI 


16100 


IFJ=99THEN16000 


16110 


IFJ=0THENLO=VAL(L$) :HI=LO:RETURN 


16120 


IFJ>1THENL0=VAL(LEFT$(L$,J-1) ) 


16130 


IFJ<LTHENHI=VAL (RIGHT? (L?,L-J) ) 


16140 


IFLO>HITHEN16000 


16150 


RETURN 


17000 


PRINT"-LINE#->"; 


17010 


GOSUB10000:REM INPUT LINE* 


17020 


L=LEN(L$) 


17030 


IFL=0THEN17000 


17040 


3=0 


17050 


F0RI=1T0L 


17060 


A$=MID$(L$,I,1) 


17070 


IFA$>="0"ANDA$<="9"THEN17090 


17080 


J=99:I=L 


17090 


NEXTI 


17100 


IFJ=99THEN17000 


17110 


LO=VAL{L$) 


17120 


RETURN 


20000 


IFEE=0THENEE=15 :0PENEE,8,EE 


20010 


INPUT#EE,E1,E2$,E3,E4 


20020 


IFE1=0THENRETURN 


20030 


PRINTEl ; " , " ; E2 $ ; " , " ; E3 ; " , " ; E4 


20040 


PRINT"*** DISK ERROR ***" 


20050 


CL0SE2 


20060 


RETURN © 



Are you using your 

computer in an 

interesting appiication? 

Write about it for 

COMPUTE! 



f ebruary, 1981. Issue 9. 



COMPUTE! 



SORT is i\ 6502 machine lunguage in-meniorv sorting iilgorithm ol commercial quality for PET and APPLE owners. Most 
sorts are accomplished in less thjiii a second atnl large sorts take only a few seconds. The algorithm is a diminishing increment 
insertion sort, with optionally chosen increments. There are no conditions under which SORT performance degenerates or fails. 

SORT requires almost no user set-up openitions. SORT handles integer, floating-point, and string arrays plus arrays of 
more than one dimension. In addititin, multi-key sorting of string arrays has heen enabled. The user may specify the character 
within a string to begin sorting on and how many characters are to be evaluated. SORT is capable of performing up to twenty of 
these multi-key sulvsorts (on matches found) at the same time. 

SORT on the PET: SORT is available for large-kevhoard PETS only. One EPROM hts all newer 40 &* SO column PETS. 
SORT EPROM comes at he.x $9000. SAGOO, or SEMOO socket. EPROM with SORT and text dump is $55.00 (postpaid). 

SORT on the APPLE H via a (.luality slot independent EPROM hoard. Board includes function driver that suppons 16 
EPROM based iunctions for user EPROMS. AF'PLE EPROM card with SORT, te.xt screen dump and function driver is 
$1 10.00 (postpaid). MASTERCHARGE i3 VISA accepted. 




MATRIX SOft^rare, inc. 3f5 Marion Avenue, Big Rapids, MI 49307 (616) 796-2483 
A Complete Line of Software for Small Businesses. 



THE PERFORMANCE SLICE 






aO 






%s^^. 



tuote 



\e 



»*S-& 



corns 



sxa^a- 



and 



en- 






yon. 



can 



'''''O'cesaT '"'^^ entry , 
^"ddelit'''"^ time r/f 

I ^„f una u " ""led this 



ACCOUNTS 

PAYABLE COMING SOON! 

• Complete your accounting system with the soon to be teleaset) 
A/P package, featuring automatic application of credit and debit 
memos, open or closed item listing, ful! invoice aging, and 
mulliple reports that provide a complete transaction review. 

* Your bookkeeping rioesn't trave lo be a bulky, complloaiEd process. Tbe 
SBCS Accounting System Is designed forflexibilhy and high perlormance 
wllh i CDSI elfecllveness sure to benefit ycur businessi 

YOU NEED EXPERIENCE WORKING FOR YOU 
Packages available al your local Apple dealer. 



SMALL BUSINESS COMPUTER SYSTEMS 
41 40 Greenwood, Lincoln, lUE 68504 C402) 4G7-1 878 





The Most Powerful Disk-Based 
Macro Assembler/Text Editor 
Available at ANY Price 



Now includes ttie Simplified Text Processor (STP) 

For 32K PET, disk 4BK APPLE II 

3.0 or 4,0 ROfVlS or —OR— or APPLE II + 
803Z [specify) and DISK II 

MAE FEATURES 

— Control Files for Assembling Multiple named source files 
from disk 

— Sorted Symbol table — Up lo 31 ctiars./label 

— 27 Commands, 26 Pseudo-ops, 39 Error Codes 

— Macros, Conditional Assembly, and a new feature vve developed 
called Interactive Assembly 

— Relocatable Object Code 

— String search and replace, move, copy, automatic line 
numbering , etc. 

STP FEATURES 

— 17 text processing macros 

— Right and left Justification 

— Variable page lengths and widths 

— Document size limited only by disk capacity 

— Software lower case provision for APPLE II without lower 
case modification 

ALSO INCLUDED 

— Relocating Loader 

— Sweet 1 6 macro library for APPLE and PET 

— Machine Language macro library 

— Sample files for Assembly and tex\ processing 

— Separate manuals for both APPLE and PET 

PRICE 

— MAE, STP, Relocating Loader, Library files, 50 page manual, 
diskette — il 69,95 

SEND FOR FREE DETAILED SPEC SHEET 

EASTERN HOUSE SOFTWARE 

3239 LINDA DRIVE 
WINSTON-SALEM, N. C. 27106 



(919) 924-28S9 



(9 19) 748-8446 



22 



COMPUTE! 



FeDruorv. 1981 Issue 9- 




NEECO PROUDLY ANNOUNCES OUR 

Y»ur complete source NEW ONE YEAR WARRANTY 

ON ALL CBM COMPUTERS! 



for all CBM Hardware 
and Software Products 



The 8032 CBM Computer is now available! 

^ commodore 



CBM 

•SOOBN 

40I6N 

■10168 

■tOSJN 

4033B 

8016 

3032 

2023 

2022 




CBM"^" 8000 SERIES BUSINESS COMPUTERS 

The new Com mod ore 8000 series computers offer a wide screen 
display to show you up to 80-ctiaracter lines of information. Text 
editing and report formatting are faster and easier with tfie new 
wide-screen display. The 8000 series also provides a resident 
Operating System with expanded functional capabilities. You 
can use BASIC on the 8000 computers in both interactive and 
program modes, with expanded commands and functions for 
anttirmetic. editing, and disK file management The CBN/1 8000 
series computers are ideally suited for the computing needs of 
the business marketplace 

CBM^" 8050 DUAL DRIVE FLOPPY DISK 

The CBM 8050 Dual Drive Floppy Disk is an enhanced version of 
the intelligent CBM 2040 Disk Drive TneCBf*/l 8050nasallof the 
features of the CBM 2040. and provides more powerful software 
capabilities, as well as nearly one megabyte of online storage 
capacity. The CBM 8050 supplies relative record files and 
automatic diskette initialization It can copy all the files from one 
diskette to another witnout copying unused space The CBIW 
8050 also offers improved error recovery and the ability to 
append to sequential files 



PRODUCT DESCRIPTION 

SK RAM-Graphics Keybaard-JO col 

I6KN PAM-Graphics Keyboard-40col S 995 00 

16K RAM-Business Keyboaid-40 col 5 995 00 

aSK RAM-Graphrcs Kcyboard-'IO col S1295 00 

32K RAM-Bl;siness Keybaard-40 col $1295 00 

16K RAW-eOCol-4 lO.'S $1^95 00 

32 K R AM-80 Col -4 I O.'S S 1 795 00 

Fnclion Feed Printer $695.00 

Traclor Feed Printer $795.00 



NOTE: 

All currtnt CBM 
production 
computers/dl*k« 
now contain 
operating syitem 
4.1 /DOS 2.1 



HARDWARE SPECIFICATIONS 

Dual Drives 

Two rnicroprocessors 

974K Bytes storage on two 

5.25" diskettes (single sided) 
Tracks 70 
Sectors 17-21 
Soft sector format 
lEEE-488 interface 
Combination power (green) and 

error (red) indicator lights 
Drive Activity indicator lights 
Disk Operating System Firmware 

(12K ROM) 
Disk Bu ffer (4K RAM) 

CBM 



FIRMWARE 

DOS version 2.1 
Sequential file manipulation 
Sequential user files 
Relative record files 
Append to sequential files 
Improved error recovery 
Automatic diskette initialization 
Automatic directory search 
Command parser for syntax 

validation 
Program load and save 



2040 

4O40 

6050 

C2N Casseite 

CSM lolEEE 

IEEE to IEEE 

801 D 

2 DOS 

4 DO'S 



PRODUCT DESCRIPTION 

Dual Floppy-343K-DOS 1 
Dual noppy-343K-DOS 2 
Dual FlDppy-974K-DOS 2 
External Cassette Otive 
CBM lo 1st IEEE Peiipheial 
CBM to 2n!l IEEE Peripheral 
IEEE 300 Baud Modem 
DOS Upgrade for 2040 
O.'S Upgrade (or 40 Column 



PRICE 

$129500 
$1295 00 
$1695 00 
S 9500 
S 39 96 
$ 4996 
S 395 00 
$ 50.00 
$ 100.00 



'Asterisks indicate tall delivery— all others are immediai»ily availatjie 



SPECIAL OFFER ON CBM COMPATIBLE BUSINESS SOFTWARE! 

Purchasing software has always been difficult due to the "you buy it - you own it" attitude of most 
vendors. We at NEECO, recognize this problem and can now, on all of the Software Packages listed, offer 
a full 30 day refund policy to NEECO's customers. Now you can purchase with confidence. Buy It - fry it; 
If the program package Is not suitable for any reason, send it back to us within 30 days and we will refund 
the full purchase price — less shipping charges! 

REQUIRES 

aK • cassetlG 

lOK . 2040 

32K • 2010 
8032 » 2O4O/a05O 
32K/8032 • 2040 



\^' 



s> 



<^ 



SOFTWARE 

Word PjD I 

Word Pro II 

Word Pro III Plus 

Word Pro IV Plus 

BPf Integrated G/L 

SPI Inventory 

BPI Payroll 

BPl Enhanced A/R 

CMS G/L 

CMS A'R 

CMS A'P 

CMS Cusloiner Mail List 

CMS Payroll 

Datasource i 



APPLICATION 

Word Process'ng 



Business 



AUTHOR 


AVAILABILITY 


PRICE 


Protessional Softvirare 


IrnmedLite 


S 29 95 

99 95 

3950O 

5950Q 


BPI 


„ 


360 00 
T B A 


CMS Software 




295 00 
195 00 


■• 




195 00 
195 00 
36000 


BMB 


AugusrSepi 


295 00 



All Business 32K/e032 + 2050/8050 

'Wordprocessing SoMware requires Qulput printer IVe reco-nmend the NEC Spmwrjter ($2995) for letter qjality 

'PET IS a regisie'ed Trademark ol Commodore Business Machines Small Keyboard PETS fequite .i ROM Retrofit Kit 

Muln-Clusler is available in Canada (rom BMB Compu Science, P O BOX 121. MiHon. Ontano, L9T2V3 

AN prjcGS rtfid speci'iCiiiior'5 are subject lo change without notice 



NEECO 

679 HIGHLAND AVE. 
NEEDHAM, MA 02194 



NEW ENGLAND ELECTRONICS CO., INC. 

■NEW ENGLAND'S Largest 

Computer Siiowroom" 



(617) 449-1760 

MASTERCHARGE OR ViSA ACCEPTED 
TELEX NUMBER 95 1 021 . N EECO 
MON-FRI, 9:00-5:30 



February, 1981, Issue 9, 



COMPUTEi 



23 



NEECO announces the MIPLOT Plotter from WATANABE 



MIPLOT WX4671 






Cod«(ASCIII 


Nvna 1 Function 


s 
if 

> 


o 


DRAM Dr.-)^ a tlidi^lit lim to itui isnirit sDfCiHed by absolute coott^indtm 


t 


RELATIVE DRAW ; Dfam a iKatgtu Itne to Itif point spfcjlied Ely lelftlivecoordinalei. 


M 


MOVE Wove v^pin per UP 10 the popnl si3«ified tjv absclule coortdinates 


R 


RELATIVE MOVE 


Wove With per up lo the point ipccif ied bv relative cooidinatm 


L 


LINE TYPE 


Specify JQlid pr brokei% 1 ine. 


8 


LINE SCALE 


Specifv the pitch of a brokm lifle (0.1 - 12.7mm) 


X 


AXIS 


Draw X or V cooidirute akif 


H 


HOME 


Return to tt\e origir^ witri tt>a pert go 


n 


s 


ALPHA SCALE 


Soecifv crtaractar (i/e 11 to IS tirnwbMic 7«tim K D.4mml 


Q 


ALPHA ftOTATE 


Specilv cttaracter orperttatioo IFour directional 


1^ 


P 


PRINT 


Draw ASCI 1 code cttaracterj 


"g 


\- ' MARK 


Draw mark centereij on the per^ poiition (Sit kirvdst 



• 26 cm X 36 cm Plotting area 

• .1 mm Addressing Resolution 

• Full ASCII in any of 15 different 
character sizes 

• Uses standard felt tip pens 



51250.00* 

•Includes interface to CBM, Atari", Apple, or 
TRS»BO*'. Please specify. 

Please CALL or WRITE for 
specifications and information. 

'*Alari is a registered trademarl< 

**TRS«80 is a registered trademark of Tandy Corp. 



ORIGINAL 8K PET 2001* OWNERS TAKE NOTE! 



The following peripherals and accessories are IN STOCK AT NEECO: 



1. AXIOM PRINTER 




• Complete PET graphics 

• Plug compatible 

• Electrostatic paper 

• 40 or 80 columns 



^299.00 



2. 16or24KEXPANDAMEM 




INTERNAL MEMORY 
EXPANSION UNIT 



• Plug compatible 

• Dynamic low heat memory 

• Proven reliability 

• No adaptor needed 



16K- '299.00 
24K- '379.00 



3. FULL SIZE KEYBOARD 



« I I r I f ( ; f ; ! 

'ttifjtittj- :(ii 

» » T t • rill 

. - - f J If-- 



'8K-2001 with original l(eyboard and buMt-in cassette 



• Complete PET graphics 

• Separate keypad 

• Plug compatible 

• With cover 



^99.95 



NEECO 

879 HIGHLAND AVE. 
NEEDHAM. MA 02194 



NEW ENGLAND ELECTRONICS CO., INC. 

"NEW ENGLAND'S Largest 

Computer Showroom" 



(617) 449-1760 

MASTERCHARGE OR VISA ACCEPTED 

TELEX NUI^BER 951021, NEECO 

MON-FRI. 9:00-5:30. E.S.T. 



24 



COMPUTE! 



Februarv- 1981 sssue 9. 



The Atari 825 
Printer 



Robert W, Baker 
Atco, NJ 

The Atari 825 printer is a dot matrix impact printer 
that can print lines up to eight inches long in three 
difl'erent character sets. The printer operates under 
complete control of an Atari 400 or Atari 800 Per- 
sonal Computer System or other compatible host 
device. The Atari 825 printer is in fact a Centronics 
737 printer, well known for its quality and durabili- 
ty. The same mechanism is also used by Radio 
Shack for their TRS-80 system, so obtaining supplies 
locally should not be a problem. 

When used with the Atari computer, the Atari 
850 Interface Module is required for operation of the 
printer. The Interface Module converts the Atari 
Input/Output protocol serial data into 7-bit parallel 
data for operation of the printer. Additionally, the 
Interface Module also provides four RS232C serial 
ports for connection of an Atari 830 Modem and 
other RS232C compatible peripheral devices. 

As mentioned earlier, the printer will print in 
any of three character sets: 

1) Monospaced (uniformly spaced) characters at 10 
characters per inch (cpi). 

2) Monospaced condensed characters at 16.7 cpi 

3) Proportionally spaced characters at an average of 
14 cpi 

Each of these character sets consists of 96 standard 
ASCII characters. The default character set is the 10 
cpi set and cannot be mixed with characters in the 
other two character sets. The condensed and propor- 
tionally spaced characters must be programmed by 
means of control codes and can be mixed on the 
same print line. When a character set selection code 
has been transmitted to the printer, the printer prints 
all characters in that set until it receives a different 
character set selection code or the printer is powered 
off. 

The monospaced characters are formed in a dot 
matrix 7 dots wide by 8 dots high. The spacing be- 
tween characters is uniform: 3 dot spaces between 
normal monospaced characters, and 2 dot spaces 
between condensed monospaced characters. In- 
cluding the dot spaces between characters, the nor- 
mal monospaced characters are considered to be 10 
dot spaces wide and the condensed monospaced 
characters 9 dot spaces wide. The pro])ortionally 
spaced characters are formed in a dot matrix N dots 
wide by 9 dots high, where N is a variable number 
of dots from 6 to 18. The numeric characters in this 



character set do not vary in width. I'hey're always 
12 dots wide and are inonospaced at 12.5 cpi to 
allow tabulating columns of numbers. With the in- 
creased dot density in the porportionally spaced 
character set, print c|uality is extremely good and 
comes close to that of "letter quality" printers. 

Elongated characters can be programmed by 
control codes and all characters can be elongated. 
The elogated characters have twice the dot width of 
normal size characters and can be mixed with normal 
size characters on the same print line. Elongated 
printing terminates when the "stop elongated 
printing" control code is programmed or the print 
line is terminated. 

The printer can print up to 80 ten character per 
inch monospaced characters on an eight inch print 
line. When the characters are elongated, it can print 
half as many characters per line. The maximum 
number of proportionally spaced characters per eight 
inch line varies with the dot width of the characters. 
Therefore, the line limit must be computed in dot 
columns with a limit of 1200 per eighth inch line. 

By decreasing or increasing the number of dot 
spaces between characters and/or words in the print 
line, you can even justify lines at the right margin. 
The printer responds to six dot spacing control codes 
that set from 1 to 6 dot spaces between words or 
characters. This feature combined with the propor- 
tionally spaced character set should make the printer 
ideal lor word processing applications. 

One special control code recognized by the 
printer activates a ninth pin in the print head to pro- 
vide automatic underlining. Both characters and 
spaces are underlined until a "stop underlining" 
control code is encountered or the printer is powered 
off. 

Backspacing is initiated by a control consisting 
of the ASCII backspace code (BS) follovs'ed by a 
character specifying the number of dot spaces to be 
backspaced. This feature is especially useful for 
priming overstrike characters such as a slashed-zero 
or a not-equal sign. The printer does not actually 
backspace in the sense that the carriage moves 
backward. The carriage can only move from left to 
right. When the printer receives a BS code, it returns 
the carriage to the left margin with no paper motion 
(no line feed) and then moves the carriage out to the 
last print column counted minus the specified 
backspace dot spaces. Then it prints the next 
character and continues the line. Remember that the 
number ol dot spaces to specify in order to backspace 
to the desired print position depends on the character 
set being used. 

The printer generates an automatic line feed 
each time the print line is terminated and the car- 
riage is relurned to the left margin. In addition, the 
printer responds to four different line feed codes to 
advance one full line, reverse one full line, reverse a 
half line, and advance a half line. This allows prin- 



DYNACOMP 



Quaiity software for 

ATARI 

PET 

APPLE II Plus 



TRS 80 {Level ID- 
NORTH STAR 
CP/M8" Disk 



GAMES, SIMULATIONS wd EDUCATION 



BRIDGEl.O (AviDibk Tor ill computm) Pri«: $n.93 C 

Sll.«$r»hkrtU 
All ilHnchfnvr i^fuon Af ilm inoii F>tic>ular ol cird tunn Thti profram bah BIDS iml FLAYS tXhcr TOrtti«(i Of 
dupliuic bibdir. Drpcndmi on itKccnuacg. juur emnput" tfpptwnh "itl tHhei pliy ili« offrti* ORdtfniK. If you bid 
liNihvTi,lt!C(Qinr'iilf'*>tMMbltT'^t (Ofl»tLir BRIIXJJ: 1 rioxidn ttuUca^mj CBunamnm) Tot id* UKrd pbym 
aid i! ui f-ictlE^ni kjrnjnt i<m1 Tor the bf Kl|r novK(. 

SI8.95 Dbkt^Cf 
Jlcc wcTiion of thn pOpuUr ct:fd jum. Hnni li i iii>:k-i>nrmiil (une m ■'hich iKc 
iti^quRftafipiiliri. Pliy*(»in«i*ocoiTipiiitrupponeTnii«tw»Ttwwnli"iihh»i(!- 



HEARTS 1 .5 (AvAllibIc for lO compuitn) 



A^ ciniini ^lad cnlertiuuni fon* 



VALDEZ (Availablv Tor all caitlpaicn) 

A iiTTiLliiion, u[ saptTianXtf ni' ■j»l'on ir Iht Pr 
2J6XIJ6 stcincrK fadii fnfcp ird employe pll)ii 



Frke: ¥14.9S CiSKtU 
Slft-M DbkclU 

il. mtxlclii □[ ihip rcipon« and tid^ pitlcin Chmf >"«i 0"fi (ourw 
cTminal miy tv UK<d (cit iliH^Ur. 



FLIGHT «ilM ULATOR (Avallible for lU computcn) 



A icfllliin: and ejiE^ikij^f miiK(mj,iu:al luiulaii'an of titc-utf, ni(h[ inJ Itmlmjf. The prugf »m usiliMi Md-JjiraiTiic cqui- 
iions uid !hc chiiacietn[i« of ■ iril alrCoJ. Ypu ttn prKlK? hlliumfnt irrpiDtchci ir.d nAvj^jiian Liimj ridiati anJ 
compass hradiniv- T^f mcfe Adianftdi Hyti rin aba prrFDrm In-opi, Kilf-rDlli ind iimilar iCToaiLic m«(itui*ri.. 



CRIBBAGE 2.0 CTRS-if} oiily> 

Hiii i\ a MFll<JetiSh«i! anJ niiCrl} cm 
inrn Idi ihe cTitbair plater in tr*v 
ikuW 'he Kat\ftt '"^ }ilt<>(> Tht 11 
■.U [P.S-^0^ (.raptiwi ^«p4Ni>lkcO. 
ni:iLin;ri itit poinit uiini rnc uiditto 



Price: Sl4.MCaiwHe 

iULf J !«□ hutd<i] vftsion of Ifit ctaiHf wfd j»fnr, cflbKige li Lt an fTccIkni pro- 
h lit 1 wunh) ciptioii«n[ a ««ll u ihc beginner wkthirttto Icam Lhc jame, in pal- 
qnJiid ctkbtuic hiorc boird 11 conlmuillT dIiowti al lhc iitpof ihc diipla;' (utiUnni 
> Lth ihv (Aidi itiiiwn ujidrmcaih. The -t'omputci auiDnuikiUf icoiri and aliQ an' 
i»] pliriKi 



CHESS MASTER (Nonh Slir ind TRS-SO only) Prfct: $19.M CsikiIc 

SU.H Dtikttu 
Thit complete and ifiy pgvnfuJ prdptr'm pfciiui^i ri>« kttli al play, li mc!u4» caiiUni. en pauani tapljrci i^ >h« 
pmEnauoQ or IU4TII. Addiiitmailj, iht twird may be rf«et beter Ih* lUrl of pL*y, ptHtiiiini (he examirucion of 
"took" playi. To muiinue e^etutit^n ^prcd. iJic pfpstiffii ii ■ricwn in attcmbly UfL|ii.ajc (by SOFIWARE 
SPECIALISTS pf CalifitmiiJ Full iiaphki aie emple>/rU ii ihe rUS-M'i.ejiiion. and f-o aidthi pf ilphwiufirffrf display 
iff provided 10 acfoiTinmSait Monfi Siar uien 



STARTRCK 2.1 (AtaUibk for aJL computcn) 



SPACETILT<Applcooly» 

L;i4['i«;air.«pid(3l«ioiUi tlKpbrieof 'cherVtcremio"Tot 
the Koifcieii ireaJlei and imaEler! AVuill ip iiBirt *I!(r*» yuuw 



PFkc:$ '«.9dCiMrltr 

iniei Foi riample. th< keikiimi mj~ ihooi ai itw Eoi«- 
Ijadcanii Tht Kluiioat also iiiai^k «t1Ii both l!(IU apd 
icnErirEnlnptiKi^bnKtcJI)) ffirrr h*«>j cfuiteiri *«1» 



Price: Sia.9i CuKtlc 

a t<aU into 1 hok m ilte uiten. Sound f^.p]c'} Ncn ''ticn 
neaiure your ikiU atainii cih.cnLnil:u habit -ficrmmB u- 



GAME5 PACK I ind GAMF^ PACK II 



Prk(:$ ».95fiicli,CuHtii 
S13.99 ekcb. UJsUlIf 

GASSESPACXlcariaintaLACKIACK. l.LSAR I ANDEW. CRAJ^. HOPSERACE. SWITCH and mof* CA-MES 
PAt'L II inctudei. fkAZY ElOJUT'S. lOTTO. ACEV-DLCtK, LlfT^ WUMPUS xnd oifwrt, A^ailaftk for M <*w- 



*h*B you Clin buy 1 DVNACOMP cotkrtior Tor jim IS *J^ 



Why pay %<•}* oi mnl» jtrt pWff » 

STUD POKER (ATARI only) 

This 11 Ihe clKiiii ■amt<!eT'i it'C fasvv TW HtinpuEef i}*'lt ih( atdi ant 
•Flic ypij KT TN' ci^ff'puter don toi iheat and utiid/It bcti ihc ciddi. Kct 
n«e i:aid dtj'* pclti bvtcmi p^atEn'e proiram Thn ^atKifr will run rn > 

NOMINOES JlCi^AW (TH^>HO only) 



Prte«;51l,»SCPwiie 
ilSM l>iikrtlc 

11 a lime and )oj land ihe cotnpuler) bel ttn 
mi. 11 wmetirm b\ath^ flivO mtrLdcd >>■ a 
lAlC ATARI CaIoi, jfapFiici, M>und. 



PrtceT$]6.95C>Mf)lr 

S20.<M Dbkfiie 

NOMI.SOES JIO^AW ii «n mrnaLnni ^d^ij ^i^!ihiifai«d|iiphl»] r^"lr T)it rifu* cciriiiiiol a »h> 9 iHiard p^rtiil!!; 
miNJ Kith nrdiaml) thmer ihapei [romirtxi J, of which thete aie U) type* By kni>\'iHi iriit ih( ihjp*i finHT t>* kially 
L-enncncd. and by gLseMinf the iliipe at ea^h li>.-aiion, <ll ifi» ^t■mln«l may be eiefiiually d^mrrf Scoring h bajcd on 
gti; nijiEntiTE a( gti«in tn^uDinl and Ihe dirfifjlty oT Ihe board tn-up 



MOVING MAZE (Applf «my) 

MOVINti MA?:t empkin Ihe t" 
d^tiaiUiixliy {and i,tndL)m]y| bujit 
(01 bcirj hil by* a *jll. S^imm ■ 

BLACK HOLt: (Appk only} 



■i]:i!iji]lr>lu(l<rKi«pucL from one vide of 1 
Ri,! It kcmilnuatly bcin« modiFicd. The ohje^i 
by an el»p»rJ lime mJkplof. ami ihrrt \f.i 



Prkt:S10,95C«MUB 
SU.45 Dbkcllr 

maic \a ihc uhci. HDne^ei. Ihe maic !■ 
veU lu (iiiii th«' maje wiihmji toiifhiri 
1 at pl»i »rrr'">"l«l 



object n I 



511,93 PhkOla 
trAphJeal iimuljuion or ihe problcmi invuhedin JowlyMbierunja hl*.;k hole Aiiha tpaccprobc The 
■ni maintain, foi a prritnbeJ lime. *n ofUl ClOi* ta a tmall hlack hDle. Thu u, la be aehie^rd ■-iffwmi 
inOmalrihaTE^iidilMr^ideMru^iirw probe ConE(&lu[«hectaflii realiUfCillv liftiulaEerfiiiiajiide 
ihruiirn for accclcraiion. Thii program tmpltiyii Hi-Po gtiphiMand i^ educaEJonaJ u wirll ai 



itin| 






:ri(!Tig, 



TEACH ER'S PET I (Available tor ill compulm) PHcr: S «.» Ctnetit 

SI1.95 Dbkciic 
niii 11 {he r>r>i iif DVNACnMP^rilLtaiicma] pjii;k4t«i PiimarJi inietiJfd let iKE-Kh4>ol Eopadc 3, TLACMtld'S Pt'T 
prai^dn the younj •lutcnE inEh cajnEini pcaL-iicc. Imei "cid ■CMOi.nilMyi »nd ihrt* itieh at rrvalh ikill r^eiciin. 



CR^ STA]^ lATARr onl}) 



A innqiit jlgjjdtJim iiriioml)- proJuiXf faHitianrj, [laptiici diip^iyi aek:ump4-riy ■ith «□ 
are buiti. Sff s^d paiEflni ace the nnie. and iftr-ifnibirTrd rf'KE af ih* unnd acid trapii:k4 
hu beeti uk4 m loiaL Mntin to Jononiiiau ih« lound and color fcaEiicn of Ehir Aiara 



Prl«:S '9.93Cju«lle 
f n.V5 lYnktm 

■% mhii^n « dry M ihe paiirrm 
rtmoitntuinj CRYSTALS 



POKER P.^kRTV (AvsJIpbIt for all coitipulrn) 



Price: S[7.9SCUMtir 
(21.95 Dbketic 

PCIKFH PARTY II a dta- pi'keir vi_nijtatron ha«*d ur ihe hiob,. KiklR. bfO^-aU Jacoft> Thiiiuhe man cunirireher. 
live ■ef'H'n j.jiUbtr (i>i itii.:ro fitnpuiert Ihe piiiy FLi>niiH.Ei o( jixirteU umJ m wher <>.vmp£inl pUteit titl^ff ihn* 
pLiviTi lyiiu Kill (CI ii> ioa* sheml ha* a dilTetcnE pcivnitil) ir ihe rocm p( a lai'ini rfi-^riit. ii' Muff lm hold LCidet 
prr,.jrr P:j.ei.c -.nh POhtX PARIVherore iinni 1,. ih.i «iwa.ivr |,iiT.r i.ihiii' 



Availabiltly 



nt NAI'oMP ^oFt-ware 11 mppUtd ■'■<h (ompltir dchcu mental ion ciHitainiri dear ciptiruiicifti aad evample*. All propim-i 
-Lt: r„n mshin tbK pt^ian rarmory fpaire (ATARI leqiiirn J'K}. Knepl nVicnoiTd. p*Hif*rtii are *»ailabk or ATAKI. 
PET. IRS'IOllrvel lliand Appk lAppbtofiJeaunteaad dttknte at wril ai North Siat iinile dmiiEytdauMedrnnlydim 
patiFkl^iilerir Aildjtioullr, moii pruframi can bcobiaiKd on ilindaid IIBM f^imaEI t" CP'>J f^r>r<} dEil^ifof Ljuiemt 
rjrninf Lrtdrr MbASiC. 



■ .4 T.iai. PET. APPLE IL TUSID. yOdtU STAS. tV >f ^."sT ^ftlf ^ft ftti^'t't'i I'Jiit mnes end or rradtmarks 



BUSINESS, UTILITIES and MISCELLANEOUS 

MAIL LIST 11 (North Star only) Prfcf: SH.95 

rh:i manr-feaiuied piofTim no* indufici full alphabei-x and tip *oJe Kniinj ai »*ll at file irmtmt Eninn can be 
reirievrd by uter-drrired rwfc, tSiem "•mj oj ZJp Code. The pHnloil formal iliay\ iFie uie of i!*nd«4 "i» iddfMi 
Ubrit Each duLriie ean iioie morr Ehan 1 100 enEf «t liingk Jenuty. o»" UM ■'Hh double denuty itiEemi)! 



TEXT EDITOR I ILetttr Wri*tr) 



Price: SU.95CuH11t 
J 11.14 DtakrlK 

An e«i 10 UK, Ucw-orwnicd iul cdiior w hwti pro'Klo rai^iM* hm wnlihi aoi umpk pir^jriph ■■3dc^4r| Thu ie"i 
editor u sUally wiird fnt cdtniMuaj letieri and ii qulir upabk of hand]in| tthkIi Ufj(* ]o*rt A.aitabk for jJI com- 



PERSONAL nNA.SCE SYSTEM IATARI Dnljr) Prt«: iMM Oiakttu 

PF$ it ■ luslc duk menu orienied synem con^poicd of 10 notrami dcu«ned 10 ait^tnj* and tintpJify |oui peioRjil 
fmimrci FeaiureiUMludea JOOtianwawn apiMriiji fiit Keei»i Ifioprwiul u»et codei: dala letTHrr*! t>» monih.rtiil* or 
psytc; opiiona: pHnunt of lepom; checiboot ba^Lancinf^ hat (r*ph pMnni ahd mw*. AJ»o proiidei on thi: dnhciir 11 
ATARI IXK :, 

FINDIT (North Star Only) Prtce: Sl»-M 

Thit II a U'TK-in-iMje pioiram -huh rMm!*iin informaiKsn aieetiiN* by key*o(d* of ihtw ixpet; Peiwnal {r( ImI 
lumr). Cdifiaieftiat |ej. ptiimbeii> and HtfcrrTM:* le|: mafannr *rtKlc». letord ■J.burtii. tiif In adduion eo teyi"o<d 
KUTcfan. dn-e are buiJiday. ano.iverMn uk) appoi/iinufii itueittt for EtK'pcTioiiair'rcoidt jindappnnEmmlKVf^hei fOi 
the «nrinei>n*! iw«di. RefereaH reeocdi ue Kcnicd tr a unfb keyvwd H by Orti-ilt*i^M*nn| i»o « tluw 

DFILE (Nortb Slar only) Pifcr:Sl».»S 

Thii handy pf (>tiam aUowi Notth Sur uien 10 miinUm a ipecUliird <^ia but el ail ftin and pioitami in ibc iiack of 
duki vKich mvaniNy a«uinulatn- DFILE it eaty 10 ki up and uif. It wdl oi|anue ytMT ditfc* to prd^ cfrii^ieni 
twa^ini it ibt dMiied Tile at pcoiram 

COMPARE (North Star only) Prt«: 4ll.« 

COMPARE II ■ iiiT|k diik uEttiiy lofi^aie package which e^ompaMi l^o bASiC pi»t[>nii and dHpUyi the Tilt iun of 
Etac proj,rani in byiei. Etir Itnithvin lenni dI ih* number of italtmcnt Linei. and thelinr numbtri at ■hifh vwipii< iiiEed 
differeiKH occuf COMPARE permiti llw uwt le eiamin* »eiwni ofhii wfKaic to ^riify *hi(h ut Ihr tPOT cuf rrnt, 
and Ici tJH-'l)' idmiify the ehan^H made djrirvi d'Ocloprrbcnl. 

COMPRESS (\iirtb Star only) Prl«: SW-W 

COMPRESS il a iLniie-H^uk LtiEily pitJfraip -hich f^nKiiei ail iinrvccnury ipacn and [opuonaJyJ REMafk lUiemrDii 
froHi North Stai BASIC pifrgfann. The loujce fik t» pionnied one line it a time, ihiii pcmidiiint lety lai(r piotraini 10 
be comprcRcd uiini only a unaU amour^t of cvin^icf mfliory . File lofflpreiiiiorki of 2&-90*b are commonly tthieted 

Ptkt: 111.93 CuHdf 
$16.9S IHdkrilE 
<u tu eatily eieate ti^phit;) Jimilr f'am ihe ieyboaid. You "draft" yoji fifure uiiij the 
pTOfFprn'ii ciicTiiive curior caniEoii. Onet ihe Tiiuic ii ntkde, li ii automaltcitl)' ippci'd^ !□ youi BASIC pioifim at a 
wrrni vBf lahlc. Draw a "happy fat*", call it 111 and ibtn piini ii f>om ftmr program uitnf PRINT HJi Thli ti a tery eaiji 
ua^ lo freitc and saur |riphi»- 



GRAEIX (TRS^ onty) 

Thii liTTiqije pioiiam allfl-wi ; 



TlDVtTRS-Sflonly) 



Price: SlO.IHCwellr 
S14.99 Dbktnt 

TIDY il ar. i»nrWy iapguBic pioiiam *hich il]o»i you to tcnuinbrt Ihe linei in your 3ASIC picgiami. TIDY alw 
rrnio^N uE:n»e«uai7 ipwci and REMark iiaLcmCTiU.. The (null h * iO)iip«cied BASIC prciiraTn whkh um mueh kii 
ircmory ipacc and eTfi.-u(?i liinlficanlty U'lKt- Om* kiaded, TIDY innatm tn memory; you roay ImiI nnjF nura^ of 
BASIC pri;i.[an!i -ithout havin.|. 10 reload TIDV! 

NORTH STAR SOFTWARE EXCHANGE 4NSSE) LIBRARY Pric« S9.« Dbkriu 

DYNACOMP no* duiiibLici ihe 20 . tclume NSSE: hbrafV Mom of ihete dukHiei otfrr an outitanduii '■tluc loi the 
purohau price. Wriic for detajli itfaiding lhc ronEenEi of ihn Itbraiy and qjaaiiiy (four or more! pu:kl^i« 



STATISTICS and ENGINEERING 

DATA SMOOTHER (No! a*ailabk for ATARI) Prtct: S14.M Cawnt 

S19.93 DbJkettf 
Thu irpettaJ daia unooihin| pioicicn may iw uted (c ttp-J^i Jffjt* wwf jl wfistmaEjon from noiiy bjuncii and entinetr- 
ia| d«ta "huh art eqijaili ^patrd The lofmare fraiurci (hoic* tn def ire and rinjie of Fil. ii "rll ■■ imnothrf fjjii and 
ueood der.vaute cakulauon. AIw inckdrd n ^uiniMMt pkiitmi of :hc inpui dau jwd imooihrd teiuKi. 



EOL'RIER .VS ALYZER (Avillibic far all CompnlM) 



Pritt: il*M CwMttc 
$!».« DbkriK 

Uie Ehii prDfraai lo uammc the Ftfqtjenfy ipatft of limiEnl dLitaiiMt iiiuJn Tlw projiam fcatuje* aulomaiK >««I4bi 
and plattir^ of Ihe inpu! d»i» aftdfKuiu. Pia^Tical ipplkabaaj iachiA ihe anaJjinof cowpUialcdi*nefnj in luih r^ 
IS c'leasenxf, eossusicilkoni Bud buviKi't 

TFA(TniiurfrFunctioD Aoalyier) Pfkt:SI9.»C««tii( 

in.9i LHikrClc 
Thii a a ip«cul wfitiarc packate -hsh may be uKdloCvgloiit Ehf iianifer f tinniont of lyucim iwh ai hiTi amrSirten 
and rdim bj examining ihcw rei*>pnK 10 puli*d LnpuTi. TFA 11 a ma^ir Rtodifkaiion of FOUKlLh ANALYZER and 
JOniaini ai ertiinKnn|-o rented drcibci i.mJi loj-frequencr plol M "fU ai Jala ediilng fraiuret. Whcreai FOURIER 
ASALVZER udojgned foi edujationai ar.d KjraEjflt ui*, TFA :i an ca|int«TkH( icol A'aiLabte foi ill con-.puwti 

HARMONIC ANA LVZ£R (Avaliabk foraU computm) Prise: S24.« Camtit 

ilt.H DbUlic 
HARMONIC ANALYZER nai dcugnni tot the ipedrum aualitia* "jf irpwitite ^avetormi. Fetitrti uidude data fik 
gOLCTaiion.eililifigaad itoraje'tetpctil " "tII ai daia and ipeciriim ^taEEini- OtieparlKuUjJy i^igw fa^iy u 
hpsri d»T* fttd not he htiiaQy ipared o: in order. The ongEnal data n loited »ftd a cubic ipiin* imerpotation a uted id 
rieaif the Jita Tile Tcquircd hj the FFT il|Qiithm. 

fOURIER ANALYZER. TTA ajwJ HARMONIC ANAL7TrH nw. be piuchaird io|«heP for i eflmhtnrd pfm* of 
iUIJ Ithtee caiKEEei) and S54.93 (iTiree 0>fkrlirt) 

REGRESSION I UvaUtbk for all compurtn) Prit»: 519.M Camtli 

m.H Dbkdlc 
REGHESSJOS I ii a iinig je and e^tepuoraUy • rtHitlk cm-dWiPHJleMJ ki« ifluarei ••peitaaxmiV ■curve nilini pio- 
iram. Feature* in^Mt'erj l^i^h actLiiaey; an *tJtoniaiicdc|r«itfieminalior opHon: an eileniive diE^inal Lbrary of fil- 
ling runaioai; data ediuai: automatic ilata and cur^e pkiRliU: * HaEsuieal analytit [eg: iEa[ida.ttl dtviaiiot:. correbti^n 
Hjeffieiieiil. etc.) and murfj taon. In addition, new Fiu may be tned wihouE reeniering the data. REGRESSION I ii tei- 
tainiy the corncnEonc proE^am in any dala analy»i tOflwart (ittinr. 



REGRESSION II <PARAFiT> (AvaJlablt fur all compulrn) 



Prkr:S19.»5CUM-l(( 
SU.95 Dbketle 

HAHAhl f 1^ de^'fnrd to hundk Ihpie J.»iei In whicfi ifir parameiert are tinbedJc^ (puiiihly norlLnciJiy) in ihe ntmig 
fuMpOfi The iiwf ilmp3y in«iii the furalonaJ fomi, including (he parameter! jAlll. AH\ etfj at oO< a! moi* I1A5IC 
iiaicmcnE lilies. Data and reiulE* may Sr manipulalrd amd pMitd ai wiih RECIHESSION I . Utr HECKESSION t for 
pol) Eiaitual ritii,ng, and PARAFIT for ihoic complicaml fuEKiioni 
REGRESSION I and It may ttr pyitha^ri logelFi" foi JW.91 ^caiwiiM) ir.d S-M 91 (diiketieil 

BASIC SCEENT1FIC SUBROUTINES, Volume I (Not available for ATARI) 

DYNACOHPiiihee«lti!ivediiiribuior Jonhe5ofi»arekr>TdEoihet<»jff..<.WrSfr/tii!^f .Ssffr-fli-fwH. inlumf I by F . 
RuclcdexhclfKCLhc BYTE/McGia»'-H:ll adierlueuifnlin BYTE mafaunr. January 19*1} ThrinmbfiSmEinMHiie be«i 
aiinnbled acttrrdiag to ,:hiplrr. Included with f*ch [olbtctjon it a iTMnu program which telNii and dcmontiiaici ca^Jt 

Dala and fuiKtion rl<>t<ing:. Lon^pki ■aj'ia.blri 
H dpcfationi 



CdLnlia 
Collet Im 
Collect lo 



Chapleii land J. 

ChapiCT t 

CtiapEeii } aiul A' KanJom nuntbn |<neiit 






Pmt PCI ciilJ«tiijn SiJ 9i Cumi^ 
lll.»SI]i>kciE« 

AU ihrFC (nSlnl^ciii^ arr .avaiiabtc fCil' f}^-^ ith-ttt cuu 

BcciLLv: ttc icii ii a '^lUi pan of the iloeunien^atiai 
DYNACOMP for JlS.JJ pJuj lit mfttr ^nd riaiidiinj 



tin^ and M9 95 |thrt< dhknteij 
BASIC ift»nri/re iubrtmlmrs. ^oJin^r / 11 1 



Ordering Informalion 



All stiieii j;e procetwd and thtpptiJ piHtpaid %4ihin4l houii- PkiK cnclo'iirparmcni »ith ordfTakmgBTih cornpuirr infoT- 
eiii^a U paying by VIS^ or Mailer Card. ii^ImIc aU numbciion c«rd Fof otdc*i OmEi* Sniih Am«iwa add 10^ I01 ihip. 
rng and handtr,g 

Add j;.?0 10 diskette pnce for &" fiopp) dak (IBM fmmal wit mtmed. CP/M. M«fe*Ofi: BASIC! 
■TRS-&a diiketter aie (ik luppbed •iih DOS 01 BASIC 

Drduc-i IQ^f wbtD Ordering 3 or oiort pro^ranu. 

lur Icm.-!! vftitaie dealer. Wfiie tor dciaited deiCTipiiori of ihr»c anil oihri rrograrni 



DYNACOMP, Inc. 

6 Rippingalc Road 
Pittsford, New York 14534 

(716) 586-7579 



>pk.M tii ^^^ N^S..k. !>.. 



26 



COMPUTE! 



Febiuarv. 1981 Issue 9 



A T A Fv- I S 2 



P R I N T E R F- R :i: N T 



^j A M I"' L e;; s 



jiOK****:****: """■ Standard character <j;et, 10 cpi 
sbcdefghiJklMi-iopqrBtuvwxyz AEiCDEFGHIJKLMNOPQRSTUyWXYZ :L23''1567a9 

ie:: i.„.. <:::ii r^^i g ^■^ r je: o< o b-ii h^:^ i-^- tf^i. o t yL=: r 3 



xixxxxxxxx — Condensed character set, 16,7 cpi 
al)cdefqhijklMnopqr5ti.ivw;;yi ABCDEFGHIJKLMNOPQRSTUVHXYZ 1231567890 
ELONGATED CHARACTERS 



***«■#**#*# — Proportionally spaced character set 
abcdefghijklmnopqrstuvwxyi ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567S9U 



E;i 3 c k t o I'l o r m 3 1 p r i n t :i. ri <3 w i i h a u [■, o m a t i c: LLLltlfirJl Jirii-.JZLfi ^- -I- -I- '■■' s t r a t i o r-i , 



The forMula for water is H,;.D -- not - [t'O x)t;»;*)K 



sup6?r & sub scripts! 



PROPORTIONAL *** CONDENSED tix PROPORTIONAL MIXED ON SAME LINE 



X ?f Y #** <; SHOWS USE OF THE BACKSPACE TO CREATE SPECIAL CHARACTERS 



ting special rnalhemadcs and chemical formulas re- 
quiring subscripts or superscripts. The auto-lineieed 
function can be disabled if desired but is not recom- 
mended when used with the Atari computer systems. 

The printer has a special line feed buffer that 
can store up to 255 line feed codes. This allows you 
to program consecutive line feed codes for paper 
handling and [)age formatting purposes. You can also 
mix line feed codes with character data, since the 
[jiinier handles line feed codes and print characters 
on a "hrst-in-first-out" basis. Any characters before 
a line ieed code are printed before performing a line 
feed, then any characters after the hne feed are 
prinled after the line feed code is executed. A car- 
riage retiu-n lioes not occur with a line feed. 

Maiuial switches on the front of the printer pro- 
vide power on/off, online/local modes, and manual 
paper feeding in forward or reverse. The printer can 
handle three (y])es of paper: 

- roll paper, 8.. 5 inches wide 

- fanfold paper, 9.5 inches wide with pin ieed holes 

- cut sheets and forms up to 8.5 inches wide 

An adjustment on the printing head allows uniform 
printing of nuilti-[)art forms as well as single sheets. 
A special ribbon is required for ribbon replace- 
ment. The ribbon is not on a typical ribbon spool. 
Instead, the ribbon used is referred to as a "zip 
pack". The continuous ribbon loop is provided in a 



plastic bag which is removed alter the ribbon is in- 
stalled in the printer. A pair of plastic gloves are 
usually supplied with each ribbon to avoid getting 
yoiu- hands covered with ink. 

Several BASIC commaiids provide easy access 
to the prnter on the Atari computer systems. The 
LIST"P:" command will list a BASIC program on 
the printer rather than on the tv screen. The 
LFRINT command is used to print any data instead 
of displaying on the screen. Use oi' the Ll'RINT 
command does not require an OPEN slalemeiu and 
can be used in either direct (typed from the 
keyboard) or deferred mode (within a program). An 
OPEN command allows opening a "logical lile" to 
the printer and then using the PRINT#... command 
to print to the printer. More details on these com- 
mands are provicied in the Atari manuals. 

All data to be sent to the ])rinter is normally 
enclosed in quotes. ASCII control codes (like linefeed 
-LF) are generated on the Atari keyboard by [jressing 
the CTRL key and holding it while pri'ssing the ne.xt 
character key. Escape code sequences (like F-SC 
SOH) are generated by pressing and releasing the 
ESC key (as many limes as needed) and then keying 
CTRL followed by the desired character. When con- 
trol codes and escape code se([uences are keyed on 
the Atari keyboard, Atari graphics characters are 
disjjlayed on the TV screen. These graphics 



February. 1981. Issue 9. 



COMPUTi! 



27 



IT'S A DAISYWHEEL COMPUTER 
PRINTER & AN ELECTRONIC 
TYPEWRITER ^|, 

BUT . . . 



Only 

$2850 

Suggested Retail 



W^-^ ...UNLESS YOUR 




PRINTER & YOUR 

SOFTWARE ARE 

TOTALLY 

COMPATIBLE 







DaisywhesI PrintBr with KSR Option 
on the Maritslt 



■ itv 



is a TYPEWRITER QUALITY, DAISYWHEEL PRINTER that is Totally Compatible with 
All Word Processors. That's because the TYPEPRINTER 221 may be PROGRAMMED 
in PLAIN ENGLISH, Imbedded within The Text File of All Word Processing Software! 

Use the 221 as your. . . 



Electronic Typewriter 

) When not being used as a Computer 
- ' Printer, the 221 becomes a fully functional 
Electronic Typewriter. 

Stand Alone Terminal 

Available options allow the 221 to 

Commuirlcato with Distant Computer 

or Information Services such as Source, 

Micronet & others. 



Additional Options 

4Kor 16K RAM Memory which can be used as INPUT or OUTPUT 
Buffers. Also use as an Automatic Spooler to your compulH. Bl-Dlrecfional 
Communicalons from The 221 to your Pet, Apple or THS-80, Nothing eiss 
to buy. Lawyers, Accountants and others will And our Automatic SMe-Out 
Type and High Density Spacing options very usehil. 



Computer Printer 

It's a Daisywhoet Computer < 
Printer with more standard features ^ - 
and available options than any other machine. 

Tele-Communications Terminal 

OpHon available to allow your , 

221 to access the Teletype & 
Telenex networks. 
Telex & Teletype an regltteml trademarlis. 



Built-in Features 

The 221 Centers Copy Automatically, Sete Columns, Prints in Reverse, 
Bold Face and Underlines Automatically. The 221 ateo Justifies Right, 
Types in Three Pitches and does Proportional Spadng. It Types In 
Spanish, French, German, Itaian and Portugese as well as English. 
And much, much more! 



Call 714/778-3443 for the dlstributw In your area. 

HOXA/ARD IIMDUSTRIES 

CopyrlgM 1980, by Howerd Industries. Inc. 



2031 E. Cerritos Ave. 7K 
Anaheim, California 92806 



28 



COMPUTE! 



Feb/uary, 1981 issue 9 



characters are not printed by the printer, but the 
printer responds to the control codes generated. 

If your BASIC program includes graphics 
characters that generate printer control codes, the 
printer will act on the codes when you try to list the 
program on the printer. This can be avoided to some 
extent by using the CHR$(nn) string function to in- 
clude control codes in a print line. Most control 
codes will require two CHR$(nn) functions, such as: 
CHRS{27);CHR$(14) to start enlongated printing. 
Note that the CHRS argument (nn) is a decimal 
number representing ihe value to be sent to the printer. 

All in all, the printer is a very good quality, de- 
pendable unit manufactured by a highly respected 
printer manufacturer. Supplies and i-epairs should be 
easily obtainable from a number of local sources. 
The primer includes a number of features thai make 
it ideally suited for most word processing and small 
business applications. It would certainly appear to be 
a very worth while investment for the serious Atari 
user. By the way, the price of the Atari 825 is very 
close to the price of a normal Centronics 737 so you 
don't pay a penalty by buying it from an Atari 
dealer. Howe\'er, remember that you do need the 
Atari 850 Interface module to use the printer with the 
Atari system. 

TABLE 1. PRINTER CONTROL CODES 

Keying ASCII Decimal Hex. Function 

Sequence Mnemonic Code Code 

This group is keyed by pressing CNTR and this letter: 



J 


LF 


10 


OA 


Forward line feed 


M 


OR 


13 


OD 


Carriage return 


O 


SI 


15 


OF 


Start underline 


N 


SO 


14 


OE 


Stop underline 


H 


BS 


08 


08 


Backspace (must 
be followed by 
character defining 
number of dot spaces) 


This 


group is keyed by ESC ESC then CTRL and this letter: 


A 


ESC SOH 


27 01 


IB 01 


1 dot space 


B 


ESC STX 


27 02 


IB 02 


2 dot spaces 


C 


ESC ETX 


27 03 


IB 03 


3 dot spaces 


D 


ESC EOT 


27 04 


IB 04 


4 dot spaces 


E 


ESC ENQ 


27 05 


IB 05 


5 dot spaces 


F 


ESC ACK 


27 06 


IB 06 


6 dot spaces 


J 


ESC LF 


27 10 


IB OA 


Full reverse line 
feed 


N 


ESC SO 


27 14 


IB OE 


Start elongated 
print 


O 


ESC SI 


27 15 


IB OF 


Stop elongated 
print 


Q 


ESC DCl 


27 17 


IB 11 


Select propor- 
tionally spaced 
character set 


s 


ESC DCS 


27 19 


IB 13 


Select 10 cpi 
mono-spaced 
character set 


T 


ESC DC4 


27 20 


IB 14 


Select 16.7 cpi 

condensed 

characters 


This 


group by 


ESC ESC ESC 


then CTRL and this letter: 


t 


ESC FS 


27 28 


IB IC 


Half-line forward 








line feed 


"*" 


ESC RS 


27 30 


IB IE 


Half-line reverse 
line feed ^ 




MIPLOT: 

the right 
plotter 
at the 
right 
price 



Designed for straight forward interface to any micro- 
computer that outputs the ASCII code. MIPLOT can even 
be used by operators with no plotter experience. 

• Incorporates pre-programmed ■intelligent" (unctions required 
for producing graphs and drawings 

• Solid and broken lino lypes can be specified 

■ Built in character generator for letters, numbers and symbols 

• Characters can l3c enlarged and rotated to four orientations 

• Special printer mode outputs character data as-ls 

• Uses commonly available hard fiber-tip pens 

• Maximum plot speed approximately 2 inches per second 

• Built in self-test mode 



'1,200 



Only 

at Systems Formulate Corporation 
(plus shipping & handling) 



Call today tor more information or to place your phone order 
(4151326-9100 • 39 Town & Country Village. Palo Alto, CA 94301. 

Wd Honor Master Charge, Visa, check or mon*?y order (Calilorni.^ rosicJents add 
6 5^0 sales tax) 



ISYsrauis formulate corporation 

SB Itnni « CouAify -nuiCB « FUo Alio, CftUitamK 94301 











* , " ■; *■" 
» C . ^ 

* ■ *; 

* *■: 

* ., ■■ 

i' 

* .. ■■.■.;'» 


FREE 
SAMPLES! 




THE UNIVERSAL FORM 

It's an Invoice • Purchase Order • Statement 
• Credit Memo • Renewal Notice • Dun Notice 

• Packing List • Patient Bill 
Buy Direct At Lower Cost Than Custom Forms. 

38 STOCK ITEMS FOR SMALL SYSTEMS USERS. 

• Pressure sensitive labels designed to fit 
Centronics, Radio Shack and Teletype Model 43 
Printers. 

• Stock paper In 21 flavors including Mini Paks in 
small quantities. 

• Continuous index cards and mailers. 

SOLD TO THE TRADE ONLY 




DEALERS ONLY - WRITE ON YOUR LETTERHEAD 

uuuuuu ououoo SS3SS3 Supply 

P.O. BOX 457 . BARRINGTON, IL 60010 
(312)992-2255 



Februofy, 1981. Issue 9 



COMPUTE! 



29 



O 



o 



o 



Don't lose your message 
because of the medium.. 






CASSETTES 

The cassette tapes used for recording data are 
composed of two parts: the cassette shell and the tape 
loaded Into the shell. The shellcan beeitheraS-screwor 
sonic weldedtypewithanon-magneticleader or a magnetic leader (socalled leaderless 
cassettes) The shell used in our cassettes is of premium quality, 5-screw. with non-magnetic leader. The 
choice of non-magnetic leader may confuse some people, but there is a valid reason. There is a splice 
required to connect the magnetic tape to the leader at bothendsof the tape. A person recording program 
material or data, using a leaderless tape, star^ds to drop a bit of data at the splice point. Notall leaderless 
tapes have the spliceandyouhavetobe very careful when buying th is type of data tape. We use standard 
leader to avoid the confusion, and unhappy customers when the first recording on the tape is always bad. 

The tape used in our cassettes is of studio quality, The same type 
of tape is used by some studios for making master recordings. The 
magnetic tape used in the cassette is the true heart of the cassette. 
You can have the best sheil made, but with low quality tape it is 
still junk 

The cassettes offered here have been chosen for the high- 
est quality components consistent with a practical cost level- 
Cassettes come packaged m boxes of 10. They are 
offered in 10 and 20 minute lengths. 

C-10 S6.95 + SI 

C-20 $7.95 + SI 

DISKETTES 

We offer two levels of diskettes: certified and non-certified. The certified diskettes have been put 
through a test to check the entire working surface for bad spots. These diskettes are certified error-free 
by the manufacturer. If you require assurance of every diskette being perfect, then the Dysan certified 
diskette is for you. 

The BASF company invented magnetic tape from which the very large and varied industryof today has 
grown. We offer the BASF premium quality (non-certified) Diskette, These diskettes enjoy one of the 
lowest reject rates of any manufacturer (all our disk-based software is duplicated on BASF). 

We are also offering diskettes from 3-fv1 SCOTCH. These come encased in a touch (PVC) jacket which 
resists handling damages. They are certified 100% error-free. Their low modulation provides better 
signal stability. 

BASF: 

Box of 5 £19-95 + Si 

Box of 10 S34.95 + $2 

Box of 100 $299.00 * $3 

3-f^ SCOTCH: 

Box of 10 $39.95 * $2 

DYSAN: 

Box of 5 $29.95 + $1 

The SoHware Exchange 

6 Souin St Millord NH Dj055 

TO ORDER TOLL-FREE: (in NH call 673-5144) 

1-800-258-1790 



30 



COMPUTEl 



February, 1981 issue 9. 



Simulated 
PRINT USING 

Jim Butterfield 

It's handy to be able to arrange numbers neatly in 
columns. Computers having the PRINT USING 
statement help you do this. If your machine hasn't 
got a PRINT USING, however, you'll need to do it 
some other way. 

There are many methods of producing this kind 
of output. One of the better ones involves extracting 
the digits, one at a time, and then printing them; 
this method is a little slow in Basic because of the 
arithmetic involved. 

I've put together a quick and fairly fast 
subroutine to help you do the job. The actual coding 
is eight Basic lines, so it won't take up too much 
space. To allow for maximum flexibility, you are 
permitted to name how many digits you want to 
allow before the decimal point, and how many after. 

The subroutine takes your value V and gives 
you back a string, V$, which you can then print. 
String V$ contains the leading spaces and trailing 
zeros to fit the space you have specified. 

The length of V$ can be worked out this way: 
You will have specified how many digits you want 
before the decimal point as variable VI and after the 
decimal point as variable V2. Add these two values 
together; then add one for the sign and one more for 
the decimal point. Exception: If you've specified V2 
as zero, meaning you want no digits after the 
decimal point, the decimal point itself will be 
dropped. 

Images, Pictures and Patterns 

There are many possible features of a PRINT 
USING system that are not included in this short 
subroutine, You should know about them; perhaps 
you would like to try your hand at adding some of 
them. 

A floating dollar sign allows the dollar sign to 
move up snugly against the number itself. A fill 
character fills up all the spaces before the first digit of 
the number; it's most often used with the asterisk 
character, to give an output that looks like 
*****12.47 for printing cheques. 

Comma insertion allows you to punctuate large 
numbers, to give an output like 3,827,149. Negative 
numbers often have many ways of display: examples 
arc -437.22, (437.22) and 437.22CR. Variable Zero 
Suppression allows you to choose whether to print a 
value of five cents as .05, 0.05, or 00.05. 

The above features, if included, would make the 
subroutine bigger and slower. Apart from a floating 
minus sign, they are not there; but a couple of 
features ha\'e been included which are important for 
financial printouts. 



All numbers are carefully rounded, so that a 
value of 12.387 will convert to 12.4 if you choose to 
show one place after the decimal. 

Overllow is tested: it would be annoying or 
disastrous to have a value of 12345 printed as 345 
just because you asked for three digits before the 
decimal! Situations like this are flagged by the 
printing of asterisks instead of the number. 

There's one type of overflow that doesn't cause 
asterisks to be printed, but in this case you're un- 
likely to mistake it for a genuine value. (Occasionally, 
when you have a number like one million, the STR$ 
function will convert h to a string like "IE +09" 
rather than the "1000000000" we might expect. 
{Why the extra zeros? They are intended to go 
behind the decimal point). This causes an odd- 
looking output of something like "IE. +09" which 
won't be mistaken for a real number. If this bothers 
you, you could add extra coding to spot it. It's pro- 
bably better, however, to think of overflow as a 
debugging tool — it must never, never happen in 
your final polished program. 

You should try to keep the number of digits (VI 
plus V2) not greater than 9. If you really want to 
print amounts well over a million dollars with ac- 
curacy to the penny, you're starting to pu.sh against 
the limits of 32-bit Basic; rounding errors will start to 
steal the occasinal penny away from you. 

The Program 

Line 50020 changes V to a rounded integer, and 
50030 converts to a string. At this point, 3.14159 
becomes the string " 3142" with spaces at the front 
padding out the string to the right length. 

Line 50040 skips decimal point insertion if we 
don't need it. Otherwise, line 50050 checks to sec if 
there are any spaces behind where we want to place 
the decimal point. For example, the value .014 might 
be held as " 14", and we'U need to re-insert the 
missing zero. Variables V5 and V6 will do this for 
us, if needed. 

Note that line 50050 leaves an "unclosed" loop 
on the stack. So long as this is a subroutine, it won't 
give us any problem: the loop will be closed when 
the subroutine performs RETURN. 

Line 50070 puts in the decimal point and any 
needed zeros. Finally, line 50080 checks for overflow 
and substitutes asterisks if needed. 

The test program, lines 100-170, produces both 
very large and very small numbers, both positive and 
negative. 

100 REM DEMO PROGRAM FOR SUB- 
ROUTINE 
110 FORJ = l to 20 

120 V =EXP(RND(l)*14-6)*SGN(RND(l)-.2) 
130 VI =4:V2 =0:GOSUB 50000:PRINTV$;" "; 
140 VI =3:V2 = LGOSUB 50000;PRINTV$;" "; 
150 V2 =4;GOSUB 50000:PRINT V$ 
160 NEXT J 
170 END 



February, 1981, Issue 9- 



COMPUTE! 





If your dala and program handling requirements are 
minimal, a mini-disk may be for you. If you want to access 
large amounts of data, program libraries, flexible user- 
defined data formating, and easy to understand documen- 
tation. CONSIDER the PET/BETA-1. 

The PET/ BETA- 1 is a fast digital tape system incorporating 
the BETA-1 drive, with a flexible user-oriented operating 
system. The double-density drive has high-speed random 
access to over 1 million bytes per digital cassette with a 
transfer rate of IK, second. 

The PETj BETA-1 operating system extends your BASIC 
with 25 new commands executable from the keyboard or 
from a BASIC program. The new commands add sophis- 
ticated data and programming capabilities easily exceed- 
ing those of the Commodore disk. 

For programs PET, BETA-1 otters program chaining and 
merging with dynamic memory management, fvlachine 



PET/CBM 



FORTH Interactive high level compiler and 
operating system 5-10 times faster than PET 
BASIC. High level block structured language. 
This is a true fig-FORTH implementation for 16 and 
32K PETs. 



TERMINAL Turn your PET into an intelligent 
terminal with one of our terminal packages. 
These are complete assembled hardware and 
software packages. All include line edit- 
ing resend, repeat key. shift lock, output to CBIVl 
printer, and more. Delivered on PET cassette 
with manuals. Inquire for modem prices. 



THE FLOPPY DISK 
ALTERNATIVE 

PET/BETA-1 



language files can be directly linked to user-defined 
commands, and any memory segment can be saved and 
relocated to any RAM location. 

PET, BETA-1 offers sophisticated data management with 
userdefined record and field formats, up to 26 named 
fields per record, with true random access to any record in 
the file. These functions are available with easy to use 
commands. 

With the PET,' BETA-1 you control huge amounts of data 
with no operator intervention. The operating system 
supports up to 4 BETA-1 drives. 

This is a complete hardware/software package, assembled 
and complete with all connectors and extensive user- 
oriented documentation. We provide technical assistance 
by phone and mail. 

PET/BETA-1 System 

Single density (512 k./drive) S555.00 

Double density (1 meg/drive) S700.00 

MANUAL loDplicatjIe to yurchasel 310.00 

SOFTWARE 

fig-FORTH, with editor, assembler S50.00 

with floating point and strings S60.00 

witti floating point, strings, macro-assembler . , S70.00 
cassette and disk interface available. 

PETTERM 1 All features above S 80.00 

PETTERM II All features of I. plus local 

text editor with down-loading capability . 90.00 

PETTERM III All features of II, plus 

80 132 column scrolling window for 

viewing formatted outputs wider than 

40 colurTins 100.00 




Sof t\A/are for small computers 



1 903 Rio Grande. Austin, Texas 78705 
P.O-B. 8403, Austin, Texas 7871 2 
1-512-477-2207 




FSS in an aulhonzed MECA Inc dealef, 

Tenas residenis add 5''q sales tax 

PET IS a registered IrademarK o1 Commodote. Inc 



32 



COMPUTE! 



FeDruory, 1981 Issue V, 



50000 REM 'USING' ARRANGE IN COLUMNS 

50010 REM V IS VALUE; VI. V2 PRINTS 

50020 V4 =INT(V*10tK2 +.5) 

50030 V$ = RIGHT$(" ' ' + STR${ V4), 

VI +V2 + 1) 

50040 IF V2<1 GOTO 50080 

50050 FOR V5=V1 +2 TO VI +V2 + I:IF ASC 

(MID$(V$,V5))<48 THEN NEXT V5 
50060 V6=V5-V1-1 
50070 V$=MID$(V$,V6,V1 +]) + LEFT$(". 00000", 

V6)+MIDS(V$,V5) 
50080 IF ASC(VS)>47 THEN V$ = LEFT$(' 

*****",V1 +V2+2+(V2=0)) 
50090 RETURN 
READY. 



ftti^**t* 




MEMOREX 

Floppy Discs 

Lowest prices WE WILL NOT 
BE UNDERSOLD!! Buy any 

quantity 1-1000. Visa, Mtsstercharge 
accepted Call free (800)235-4137 
for prices and information. All 
orders sen! postage paid. 

PACIFIC EXCHANGES 

100 Fool hill Blvd 
San Luis Obispo. CA 
93401 (InCal call 
(805)543-10371 




PET t APPLE II USERS 

Tiny Pascal 

Plust 
GRAPHICS 



Trie TINY Pascal Syslem turns yfjuf APPUE II micro inio a 16 fall P-machiny Vou 
too tan learn the lanQ jage that is sJatfld to bctome Iha successor to BASIC riNY 
Pascal oHers [lie following 

■ LINE EDITOR lo cr*fttB. modlly end malnlaln iource 

' COMPILER to protJucs P-corJ*. tli9 asserrbly langauagfl of (he PmBchlns 

' IHTeRPRETEH 10 Bxflcuta Ih* compllad P.coda (haa TRACE! 

' Slruciurad proflrBrnmod conetruclsrCASEOF-ELSE, WHILEhDO IF-THEN 

ELSE, REPEAT-UNTIL. FORTO/OOWHTO.DO. BEGINEND, MEM CONST 

VAR ARRAr 

Our new TINY Pascal PLUS- proviaes grapfiics and otriet Ouillm functions 
GRAPHICS, PLOT, POINT, TEXT. INKEY. ABS AND BOH The PET version sup- 
ports ijouble density plotting on do column S[;reen giving 80 x 50 plot positiona 
The APPLE II mslon supports both LORES and HIRES «w1h COLOR 
HGHAPHICS. HCOLOR, HPLOT, AND POL For those ot you *hg aa not require 
grajjhics caoabitillas. you may 91III order our oriernat ItNY Pascal package 

PET BAStC 4.0 veralori Available February 1981 

TINY Patpil PLUS ■ ORAPHICS VERSION. 
PET 32K NEW Ponis cassette 

PET32KNEVVHcr«3dr5l<otle 

APPLE It w:ROM Applesol! only w/OOS. . . 

TINY Piical NON GRAPHICS VERSIONS- 
PET 16K32K NEW Poms cassette 

PET 16K,3JK NEW Poms dishetto 

APPLE It wlHOM Applosott 3JK WJDOS 
APPLE II WJRAM ADplosott ISK wiDOS. 

USER'S Manual irolundablu wilh aolluvare order) 
6502 Assembly LtstlnQ of INTERPRETER graphic! 
non-grapmcs 

r "it r'-i>J»3f .1 U S tna Cl.mox OiSwit mt^ t-t crtpud 2- B, 
ifjr.d ,,» !,.( EnjFl,:( fl.:B^J 




^jfunznn 



nimm 



ABACUS SOFTWARE 

P. 0. Box 7211 
Grand Rapids, Miclngan 



49510 



PET 




GAMES 

Unique, Action-packed Games. 



NUCLEAR WAR hOuclaar confrontation on a global seals. 

Many scenarios. 



APPLE 



GALAXY 



Pillage a 3-0 galaxv collBcting loot from 
captive worlds. 



STOCK MARKET Rags to ricties game of buv anti sell with 
computer stocks- 



ENCRYPT 



ALIEN 



Challenging puzzles, decipher caijed 
messages. 

Protect the faderstion. Real time 3-0 
navigation.* 




All are User-tested with HELPS Multi-player games have Single-player option 

Each . . . Cassette J14,95 Diskette J19 95 

• one-player 




1903 Rio Grand* 

ftus-tin, T«x«« 
76705 



i.aLll ooitiiotJ-t^r-a 



1-512-477-2207 



P.O. Box 8403 

Auitin. Texas 

78712 




mastef diatge 



February, 19B1 Issue 9. 



COMPUTE! 



33 




THE STAR MODEM 



From Livermore Data Systems 



RS232 MODEM 
IEEE 488 MODEM 
RS232 CCin 
IEEE 488 CCITT 



SALE $135 

SALE $245 

$170 

$280 



STAR Modem IS Ihe price performance leader with a lull 
2 YEAR FACTORY WARRANTY 




WE CARRY THE BLACK APPLE 



Ml PLOT Intelligent Plotter 
by Watanabe Instruments (Dlglplot) 



EBS Business System for PET/CBM S795 

Extremely comprehensive package lor small txisiness 
Fully integrated inventory and accounts receivable system 
including invoices, packing slips, mail latiels, statements, 
bank deposit slips, and 17 reports Allows any of 10 
standard letters to lie merged with customer record info on 
eilher a selective or complete file basis. Demo disk and 
system description available for S3. 00 

OZZ Data Base System tor CBM BD32 S335 

Flexible file tiandling and report writing package for sucti 
3pplicauon-.--js: Inventory Control, Management Informa- 
tion, Mailing List: Scheduling Medical Record Keeping, 
Accounling 



7.45 
3.40 
515 
6-45 
7.90 



6502 

6502A 

B520 PIA 

6522 VIA 

6532 

2114-L450 

2114-L200 

2716 EPR0M(5 volt) 

TMS 2532 EPROM 

4IIE-EQD 11 RAM |NEC| 

S-100 Wire Wrap 



10/6.95 50/6.55 

10/7.95 50/7.35 

10/4.90 5Q/4.45 

10/6.10 50/5.75 

10/7,40 50/7,00 

3.45 20/3,35 

4,15 20/3,95 

10.45 5/990 



100/6.15 

100/6,90 

100/4,15 

100/5,45 

100/6.60 

100/3.25 

100/3.75 

10/9.50 

29.00 

lir 35.00 

2.65 



CASSETTES - AGFA PE-6t1 PREMIUM 

High output, low noise. 5 screw tioosing. labels 
C-10 10/5.65 50/25 OC 100,"18 00 

C-30 10/7.30 50/34.00 100,'66 00 

All other lengths available Write lor pnce list. 



A 



ATARI 800 $777 

All Atari Modules Z0% OFF 
SPECIAL-purchase ATARI 800, receive 
extra SK memory FREE. 
EDUCATIONAL PLAN • buy 2 ATARI 
Computers, receive 1 ATARI 400 FREE! 



DISKS 

(write for quantity prices) 




SCOTCH {3M) 5" 


10/2.85 50/2.75 100/2.65 


SCOTCH (3M) 8" 


10/2.95 50/2.85 100/2.75 


Maxell 5" Double Dens 


10/4.25 50/4.10 100/3.95 


Maxell 8" Double Dens 


10/4.65 50/4.50 100/4.35 


Verbatim 5" 


10/2.45 50/2.40 100/2.35 


(add .75 for 5" Verbatim plastic storage box) 


Verbatim 8" Obi Dens. 


10/3.35 50/3,25 100/3.15 


BASF 5" soft 


10/2.60 20/2,50 100/2,40 


BASF B- soft 


10/2.40 20/2.35 100/2.30 


Diskette Storage Pages 


10 (Of 3.95 


Disk Library Cases 


B' ■ 2.85 5- - 2.15 



gl BellbHdujell 

MoiJi [ncmsivin ruHntu j. mdwhi b» 

||npplG comiMter inc. 



KM MM Pascal for PET S75 

Subset of standard Pascal with true machine language 
translator lor (aster execution 16K with tape or disk 

EABL Inr PET (disk llle based] S65 

Editor. Assemt)lH, Relocaier. Linker to generate relocat- 
able objecl code. 

tiillF()RTH+ tor PET/CBM $65 

A lulHeatured FORTH ivith extensions conforrtiing to Forth 
Interest Group standards Injiudesassembler. string process- 
ing capabilities, disk virtual memory multiple dimensioned 
arrays, floating pom I and integer processing 






commodore 

CBH-PET SPECIALS 

A, Up to S235 free 
.^kS* merchandise with purctiase of 

V one ol tollowing CBM-PET items! 




B032 32K ■ 30 Column CRT 

8016 16K ■ 80 Column CRT 

8050 Dual Disk Drive-1. 020.000 Bytes 

CBM Modem ■ IEEE Interlace 

CBfil Voice Synthesizer 

8N Full SIZE graphics keyboard 

16K Full Size Graphics or 

Bijsiness Keytx)ard 
32K Full Size Graphics or 

Business Keyboard 
204 [I Dual Disk Drive - 343.000 bytes 
2022 Tractor Feed Printer 
C2N External Cassette Deck 
Used PETs (8, 16, and32K) 
WRITE FOR SYSTEM PRICES 

"EDUCATIONAL DISCOUNTS" 

Buy 2 PET Computers, get 1 FREE 

CBM Full Size Graphics Keyboard 
WordPro III - 32K CBM. disk, printer 
WordPro IV - 8032, disk, printer 



FBEt 

51795 !36 

S1495 205 

SI 795 Z3S 

S395 5f) 

S395 50 

S795 100 

S995 150 

S1295 205 

SI 295 205 

S795 100 

S95 12 

CALL 



S 74 
SI 70 
S255 



VISiCALC lot PET. ATARI 

BPI General Ledger. MP. A/R for PET 



$170 
S270 



Programmers Toolkit - PET ROM Utilities S34.90 

PET Spacemaker Switch $24,90 

Oust Cover for PET S6,90 

IEEE-Parallel Printer Interface lor PET S65.00 

IEEE-RS232 Printer Interface for PET S149.00 



SPECIAL 
$1145 




• Incorporates all intelligenl functions requited tor pro- 
ducing graphs and drawings including 8 vector and 4 
character commands. 

• Distance accuracy within 1%, repetition accuracy 
within 01 inches, programmable step size ,004 inches, 
internal Interpolation in .002 steps. 

• Solid and broken line types can be specified 

• Characler generator for letters, numerals and symbols 
Cfiaraclers can be enlarged and rotated in four orienta- 
tions 

• Coordinate axes can be drawn by simply specifying the 
graduation interval and number of repetitions 

• Self test mode automatically draws comptete lest pattern 

• Printer mode outputs character data in 1 6 sizes with 4 
orientations 

• Connection lo any microcomputer using parallel 7-bit 
ASCII code 

• Can use simple cable to parallel porl. or special inler- 
lace lo IEEE o( other 

• Modular control Circuit and mechanical construction. 

• Uses any hard liber-tip pen 

• Uses 11x17 paper 

Includes power supply I/O connector, 2 pens, 50 stieels of 
paper and complete manual 



115 E. Stump Road 
IVIontgomeryville, PA 1 8936 



21 5-699-5826 



A B Computers 



EPSON MX-8fl Primer $545 

STARWRITER Daisy Wheel Printer S1500 
Centronics 737 Printer S790 

NEC Spmwriter - parallel $2500 

XYMEC H l-Q 1 000 Intelligent Daisy Wheel $21 50 
Leedex Video 100 12" Monitor $129 

ZENITH DAT* SYSTEMS 
Zenith Z 1 9 Terminal (factor/ asm I $735 

Zenith Z89 with 46K S215(] 

SYM-i ' SM9 

SYM BAS-1 BASIC or RAE-1/2 Assembler S 85 
KTM-2/80 Synertek Video Board S349 

KIM-1 (add S34 for power supply) SI 59 

Seawell Motherboard - 4K RAM St 95 

Seawell 16K Static RAM ■ KIM, SVM. AIM $320 
KL-4M Four Voce Music Board and Visible Music 

Moniloi (4 Voice) for PET S5990 

Fl'exrLe Dalabase-Report Writer by (Michael Riley 
Flexible file handler for PET/C_BM 

MlcS"-RSSsi''fo77£Tby M"chaerBTe7' $9,95 
Machine language version— you can't wjn at Level 5, 

PAPER-fvlATE 60 Command PET Word Processor S29 95 
FulMeatured version by Michael Riley 

A P Products 15% OFF 
APHobby-Blox 15% OFF 

ALL BOOK mil SOFTWARE PRICES DISCOUNTED 

Tlie 8086 Book (Osborne) S12 75 

Z8000 Assembly Language Programming SI 0,60 

PET Personal Computer Guide (Ostjornel $12 75 

PET and the IEEE-488 Bus (Osborne) S1Z75 

6502 Assembly Language (Osborne) S 9 90 

Programming the B502 (Zaks) S1045 

6502 Applicalions Book (Zaks) S1045 

6502 Software Cookbook (Scelbi) S 945 

CPIM Handbook (w/ M P/M) Zaks $1 1 .85 



WRITE FOR CATALOG. 

AddSI 25 per order for shipping We pay balance of UPS surface charges 
on all prepaid orders Prices listed are on cash discount basis Regular 
prices slightly higher 




34 



COMPUTE! 



Februory, 1981 Issue 9 



Part 2 of several 



The Mysterious And 
Unpredictable RND 



Bob Albrecht and 
George Firedroke 



trp'tnl by tfOihffi fnt i/^HTtmni mr i\ i^uirtlni 



Integer RND Numbers 

It's true. RND numbers are greater than zero and 

less than one. 

0<RND(1)<1 

Another way to say it: RND numbers are decimal 

fractions between and 1 . 

But what if we want random integers from 1 to 6 
(as in roiling a die) or random digits 
(0,1,2,3,4,5,6,7,8,9) or random integers from 1 to 
100? 

Well, if RND(l) is a number between and 1, 
then 10 times RND(l) must be a number between 
and 10. OK? Hmnun ... not so sure? Try this pro- 
gram . 

100 REM"""RND NUMBERS BETWEEN ZERO AND TEN 

110 PRINT " CCLRD" ; 

120 INPUT "HOW MANY RND NUMBERS" ; N 

130 PRINT 

200 REM"""PRINT N RND NUMBERS C10"RNDC1)) 
210 FOR K = 1 TO N 
220 PRINT 10"RNDCn, 
230 NEXT K 
2^*0 PRINT 

999 END 

Here is a sample run. 



HOW MANY RND NUMBERS? 16 



3. J'J^&'tS^S 
3.6922388'+ 
7.7'i50&203 
5. 07949563 
9. 7S3142'+9 
B.0i+'+958it5 
.0878570662 
7.02014795 

READY 



.328904955 
6. 31052523 
35766491 
26821156 
95072511 
15665136 
47048625 



2.49452329 



Yes, all 16 numbers are between anti 10. In the 
above sample the smallest number is .0878570662 
and the largest number is 9.78314249. 




Now, think of each number as having an integer 
part to the left of the decimal point and a fractional 
part to the right of the decimal point. 



6.731052513 



integer part 



fractional part 



February. 1981. Issue 9. 



COMPUTE! 



35 



Moving with You into the '80s 

Microcomputer Courseware 

From Scott, Foresman, 

the Education Expert 




Reading Skills Courseware Series (Grades K-6) 
and Mathematics Courseware Series (Grades K-8) 
feature: 

• content correlated with basal series — to 
supplement instruction, provide enrichment 

• individualizing capabilities that meet each pupil's 
learning needs 

motivating animation, color graphics, music, and 
speech 

• comprehensive Teacher's Guides 

School Management Applications for 

administrators feature; 

• fourteen modules, each programmed to 
streamline a specific area of school 
administrative work 

• easy information storage and access, clearly 
organized printed reports 

• program instructions in plain English, helpful 
Reference fvlanuals 



Scott, Foresman Module Packages 
(Grades 1-3) for Speak & Read™ Educa- 
tional Model, complete with Pupil Books, 
Teacher's Guides, and optional Work- 
books, can enhance any reading cur- 
riculum by reinforcing essential skills. 



Scott, Foresman and Company 

iil; 1 ' Electronic Publishing 

Glenview, Illinois 60025 

Learn more. Mail this coupon c:02 

to receive free information. gi.^pj,i 

To Scott, Foresman Electronic Publishing 

Name 

Please send me free, full-color brochures on: 

U Reading Skills Courseware Series and Mathematics Posiiion 

Courseware Series (E0103) 
D School f^anagement Applications (E0101) 
D Scott, Foresman Module Packages for Speak & city siaie zip Code 

Read™(E0141) 



36 



COMPUTE! 



February. 1981 Issue 9 



Here is a program to print random digits. Each 
number printed will be a single digit, or 1 or 2 or 3 
or 4 or 5 or 6 or 7 or 8 or 9, The random digit is 
computed and printed in line 220. 



10^ REM"""RANDOM DIGITS; 01234567 

110 PRINT " CCLRU" ; 

120 INPUT "HOW MANY RANDOM DIGITS" ; N 

130 PRINT 

200 REM---PRINT N RANDOM DIGITS 

210 FOR K = 1 TO N 

220 PRINT INTC10-RNDC1)) , 

230 NEXT K 

240 PRINT 

999 END 

A sample run might look like this. 



8 9 



HOW MANY RANDOM 


DIGITS? 


20 




3 6 

5 5 

6 
2 8 
5 8 


5 
7 
8 

9 




6 
1 
3 
5 



READY. 
■ 

Do you understand how the program works? The key 
is line 220, 



It goes like this. 

• RND(l) is a number between and 1. 

• 10*RND(1) is a number between and 10. 

• The integer part of 10*RND(1) is a single 
digit, through 9. 

• Aha! INT{10{RND(1)) is a single digit, 
through 9. 

Exercise 4. 

(a) What is the integer part of 7. 15665136? 

What is the fractional part? 



(b) What is the integer part of 5.07949568? . 
What is the fractional part? 



(c) Beware! This one is tricky (but you can do it). 

What is the integer part of .328904955? 

What is the fractional part? 



For each RND number between and 10, the in- 
teger (whole number) part is a single digit. So, let's 
tell the PET to keep the integer part and get rid of 
the fractional part. 

Here's how. We will u.se the INT function. In 
case you are not already famihar with the INT func- 
tion, here are some examples. 

INT(6. 30152513) = 6 

INT(7.15665136) = 7 
INT(5. 07949568) = 5 
INT(. 328904955) = 
INT(1. 95072511) = 1 
For positive numbers, the INT function gives the in- 



teger part of the number and throws away the frac- 
tional part. 

Exercise 5. Complete the following. 

(a) INT(2. 49452329) = 

(b) INT(. 0878570662) = 

(c) INT(7) = 




What happens if you ask the PET to compute the INT 
of a negative number? Try it and find out. 
Exercise 6. Show how to rewrite line 220 to get 
integers in each range shown. 

(a) or 1 220 

(b) 0, 1, 2, 3, 4, or 5 220 

(c) to 99, inclusive 220 

Hmmm . . . suppose we want to simulate (imitate) 
rolling dice. We need integer RND numbers from 

1 to 6, inclusive (1 or 2 or 3 or 4 or 5 or 6). 
220 PRINT INT(6*RND(1)) + 1, 
Let's see now, how does that work? 

INT(6*RND(1)) is an integer, to 5. 

INT(e'RND(l)) + 1 is an integer, 1 to 6. 

In our program on page 9, change line 220 as shown 

above. Also, change line 120, as follows. 

120 INPUT "HOW MANY DIE ROLLS" ; N 

Go ahead — try it. Here's what happened when we did 

it. 



HOW MANY DIE 


ROLLS? 


20 




4 2 

1 1 
3 1 

2 1 

1 6 




2 
2 
5 
5 

4- 


6 
1 
3 
2 

5 



READY . 
■ 

Exercise 7. Show how to rewrite line 220 to get 
integers in each range shown. 

(a) 1 or 2 220 

(b) l,2,3,4,5,6,7,or8220 

(c) 1 to 100, inclusive 220 

The next two are tricky! 

(d) 2 or 3 220 

(c) 2, 3 or 4 220 

Now try these. What numbers might be ]H-inted by 
each PRINT statement 

(0 220 PRINT INT (4*RND(1)) + 5 

(g) 220 PRINT 2*(3*RND(I)) + 1, 



Februaiy. 1981- Issue 9 



COMPUTE! 



8? 



meet a 




PLUS 




Model IIM6KS859 




Color Computer 4K S 3 1 




Model II 64KS 3375 



Here are just a few of our fine offers . . . 
call toll-free for full information. 



PERIPHERALS 

Expansion Interlace OK 
Expansion interlace 16K 

+ Expansion interface 16K 
Expansion interlace 32K 

+ Expansion Interlace 32K 
16KRAMN.E.C. 200N.S. c 

MODEMS 
Lynx Direct Connect 
COMM 80 interlace 
Ciiotterbox inteftoce 
Teieplione interface il 

PRINTERS 
Line Printer iV 
Daisy Wiieei il 
Line Printer VI 
NEC Spinwriter 5530 
OKiDATAMicroiineSO 
EPSON IV1X80 

DISK DRIVES 
Model liM-Drive 
PE(?COMTFD100 
TEAC40Traci< 



COMPUTERS 




Model II 64K 


$3375 


Model III 4K LEVI 


599 


Model IIM6K 


859 


Model III 32K 


989 


+ Model III 32K 


929 


Model III 48K 


1099 


+ Model III 48K 


999 


Model III 32K 




2 Disc & RS232 c 


2149 


Color Computer 4K 


310 


Color Computer 16K 


439.95 


+ Color Computer 16K 


399.95 


Color Computer i6K 




w/extended basic 


489 


Pocket Computer 


199 


VIDEOTEX 


329 


APPLE 48K only 


1119 


ATARI 800 16K 


789 



+ Computer Plus New Equipment. 
1 80 Day Extended Warranty 



$249 

359.95 
339 

469.95 
399 

flips 49 

219 
159.95 
259.95 

169 

849 

1695 
999 

2650 
595 
545 

712 
389 
319 



PLUS real back-up warrantees — 



Pure Radio Sfiaci< equipment warranteed at any Radio 
Sliacic store or dealer. Foctory warrantees on Apple and 
Atari equipment. Ottier equipment carries manulocturec's 
warranty or Computer Pius 180 day extended warranty. 
Combined warrantees carry Computer Pius 180 day wor- 
ronty or original manufacturer's warranty. 


















LJLJ LJ LJ !_)[::] LJ L^ ■> U U ■! O 

i—iLj^'L-jLULJOLJLJLjaaijaD 






»ocket Computer S199 



n 

check out these 

unusual package 

values for price 

and warranty 



^ 



MODELI32KE.i 
1st. Drive. Line Printer IV, 
10 Diskettes PureR.S. SI 875 

combined warranty 1699 



MODEL II 64K w/2 Disks, 
Daisy Wtieeill, Scripsit 

PureR.S. 



6350 



MODELIII48K, 1st. Drive, 
Line printer IV, Scripsit Word 
Processor. 10 Disl<ettes 

PureR.S. 2800 
combined warranty 2699 

COLOR COMPUTER 16K CC 
w/extended basic cassette 
recorder, )oy sticks, dust cover 

Pure R.S. 569 



POCKET COfvlPUTER w/interface 
Pure R.S. 

ATARI 

48K Atari 800, Atari 826 Printer, 

Atari 810 Disk Drive 

APPLE 

48K Apple 11 & Apple II Disk 
w/controller, D.O.S. 3.3, 
Printer Card and Cable, 
Epson MX80 Printer 

call TOLL FREE 

1-800-343-8124 



239 



2125 



2350 



com 



DEALER INQUIRIES ARE INVITED (617)486-3193 
Prices subject to cliange wittioul notice. 
Not responsible for typogrophical errors, 
TRS-SO Is a registered trademark ol Tandy Corp. 




Write for your 
free catalog ... 

Dept. B 

245A Great Rood 
Littleton, MA 01460 



38 



COMPUTE! 



Februofv- 1981. Issue 9. 



Coin Flipper 

Let's ask the PET to flip a coin for us. Well, actually 
let's ask the PET to simulate (imitate) flipping a 
coin. Here is one program to simulate flipping a 
coin. 



10^ REM"""CO!N FLIPPER IS 1 



FLIPS 



200 REM"""FIND OUT HOW MANY 
210 PRINT " CCLRD" ; 

INPUT "HOW MANY COIN FLIPS" 

PRINT 



220 

230 



Let's try it. 






r 

HOW MANY 


COIN FLIPS? 10 




HEADS 


HEADS TAILS 


HEADS 


HEADS 


TAILS HEADS 


TAILS 


TAILS 


HEADS 





READY 

■ 

We got six HEADS and four TAILS. RUN the pro- 
gram several times, using various numbers of flips. 
Count the HEADS and TAILS each time. 

When \vc flip a coin, we expect that HEADS 
and TAILS are equally probable. That is, we are as 
likely to get HEADS as TAILS. We also expect that, 
if we flip a coin many times, the number of HEADS 
and the number of TAILS will be about the same. 

Let's modify our program so that the PET 
counts the HEADS and TAILS. In the following 
program, we have added lines 300 through 320, 
changed lines 430 and 440, and added lines 500 and 
510.' 



100 REM"""COIN FLIPPER #2 

200 REM"""FIND OUT HOW MANY FLIPS 

210 PRINT " CCLRD" ; 

220 INPUT "HOW MANY COIN FLIPS" ; N 

230 PRINT 

300 REM-"""T = TAILS COUNTER H = HEADS 
COUNTER 

310 T = 

320 H = 

400 REM"""FLIP COIN N TIMES, COUNT TAILS 

AND HEADS 
h\$ FOR K = 1 TO N 
420 COIN = INTC2-RNDC1)) 
430 IF COIN = THEN PRINT 'TAILS', 

; T = T + 1 
440 IF COIN = 1 THEN PRINT 'HEADS", 

: H = H + 1 
450 NEXT K 

500 REM"""PRINT RESULTS OF N FLIPS 
510 PRINT "I GOT" H "HEADS AND" T "TAILS. 
999 END 



Now a RUN will show the actual "flips" on the 
screen, followed by the number of HEADS and the 
number of TAILS. 



400 REM"""FLIP COIN N TIMES, PRINT EACH EVENT 

410 FOR K = 1 TO N 

420 COIN :: !NTC2"RNDCl))-»Cwill beeitherOor 1 

430 IF COIN = THEN PRINT "TAILS", 

440 IF COIN = 1 THEN PRINT "HEADS", 

450 NEXT K 

460 PRINT 

999 END 



HOW MANY 


COIN FLIPS 


? 24 




TAILS 


HEADS 


TAILS 


TAILS 


TAILS 


HEADS 


HEADS 


TAILS 


HEADS 


HEADS 


HEADS 


TAILS 


HEADS 


TAILS 


TAILS 


HEADS 


TAILS 


HEADS 


HEADS 


TAILS 


HEADS 


HEADS 


TAILS 


HEADS 



I GOT 13 HEADS AND 11 TAILS 
READY. . . ■■ 




How does the program work? In line 420, COIN will 
be either or 1 . If COIN is 0, then line 430 will 
cause TAILS to be printed and the value of T to be 
increased by 1. 
430 IF COIN = THEN PRINT "TAILS", :T = T + 1 



If COIN is 0, all of this is done. If 
COIN is not 0, none of this is done. 



If COIN is 1, then line 440 will cause HEADS to be 
printed and the value of H will be increased by 1 . 
440 IF COIN = 1 THEN PRINT "HEADS", : H = H + 1 



If COIN is 1, all of this is done. If 
COIN is not I, none of this is done. 



This program is OK for small samples. However, if 
you ask the PET for a larger sample (for (example, 
1000 nips) then alas, only part of the sample will be 
on the screen along with the number of HEADS and 
the number of TAILS. 

So, instead of printing HEADS or TAILS on 
the screen, let's tell the PET to "flip" a COIN N 
times and count (but don't print) the number of 
HEADS and the number of TAILS. 

Exercise 8. Complete the following program to flip a 
coin N times and count the HEADS and TAILS. 

100 REM"""COIN FLIPPER «3 

200 REM---FIND OUT HOW MANY FLIPS 

210 PRINT " CLRD " ; 

220 PRINT 

230 INPUT "HOW MANY COIN FLIPS" ; N 



300 REM"""T = TAILS COUNTER, H = HEADS COUNTER 
310 T = 
320 H = 



February, 1981. Issue 9, 



COMPUTE! 



39 



Announcing the magazine specifically for 
the educational user of microcomputers. 



Edunational 
uompuier 

■ magazine 



Beginning with Ihe May-June 1981 issue, it will no longef be necessary for you lo 
iniefpret the technical jargon o( engineers. Tfiis tji-montniy publication will present 
current information in a clear, concise and readily compretiensible manner 
EDUCATIONAL COMPUTER tias been crealed wltti you m mind 

EDUCATIONAL COMPUTER'S main obiecfive is lo become a ma|0r informalional 
exchange for not only elementary and high schools, but for colleges and universities as 
well All of us can learn from each other, and EDUCATIONAL COMPUTER will be there 
to help spread the word 

Everf classroom and atery Wschar will have an educanonal computer. 

Every classroorv artd every teacher should have EDUCATIONAL COMPUTER magazine. 

Subscribe early and save. If you order EDUCATIONAL COMPUTER belpre March 10. 
1981, you will receive the hrst year's subscription for S10 instead of Ihe normal rale of 
$12 per year. The newsstand price is S2.50 per issue. 



• EDUCATIONAL COMPUTER wili address the impact of microcomputers | 
in our schools, colleges and universities. 



• EDUCATIONAL COMPUTER will cover critical issues that confront 
users of microcomputers in education. 



EDUCATIONAL COMPUTER will include articles by aducators 
concerning their experiences with these new and Important classroom 
tools. 



Edunational 
bomputer 



PC Box 535, Cupertino CA 95015 



Enclosed is my SlO for one year (it ordered before March ID, 1981) 
□ Check a Money Order 



Address 



City 



Slate 



Zip 



Canada Same as U S, m u S funds 

Other Foreign: S18 one year only. U,S lunds 




NEW ROMS!!! 



DOS on ROM for ^+,0 
AND 3,0! Supports 
the \VEDGE commands 
that you are used 
to. ONLY S59.95! ! 



EDnCATORS.... 

CAN YOUR SOFTWARE PASS THIS TEST? 

DOES IT OFFER: 

1. PHOGHAWIABILITY by USER for ALL subjects? 

2. MULTIPLE CHOICE or FILL-IN at Educator's discretion? 

3. Individual Student Record-keeping 8r Printout? 

k. STACKED or SIDE BY SIDE answers at Educator's Request? 

5. PROTECTION from Student STOPPING or LISTING program? 

6. Upward compatibility with ALL ROMS including ^.0? 

7. A RETURN and no entry defaults to a '.VRONG ans'wer? 

8. FREE memory status ON SCREEN as tests are created? 

9. AUTOMATIC creation, OF DATA STATEMENTS? 

10. Created tests may be SAVED to DISC or TAPE, 
OUR 3CH00LPAC-1 Package DOES ALL THIS AND MORE! 

SCHOOL PAC-1 DiscorTape — ONLY $34.95 



MACHINE LANGUAGE UTILITY-PAC! 
kK of Firmware including DOS! 
ROM is a M/L Toolkit allowing 
50 Extra Commands. Order Now! 
UNBELIEVABLE! Only ... .879.95 ! 



Basic UTILITIES k.O- 2K on ROM 
10 Commands, allows programmers 
to MERGE, RENUMBER, TRACE and 
CHECK VARIABLES, etc. Located 
at $9CC0 hex! Only S39.95!!!! 



COMPETITIVE 



SOFTWARE 

21650 Maple Glen Drive 
Edwardsburg, MI 49112 



ADD $2 FOR S/H to ALL ORDERS! '.VE ACCEPT VISA & MC Orders! 



40 



COMPUTE! 



February. ''81 issue 9 



k^^ REM"""CL[P COIN N TIMES, COUNT TAILS £ 

HEADS 
410 FOR K = 1 TO N 
420 COIN = INTC2==RNDCU) 
430 IF COIN = THEN 

440 IF COIN = 1 THEN 

450 NEXT K 

500 REM---PRENT RESULTS OF N FLIPS 

510 PRINT "I GOT" H "HEADS AND" T "TAILS." 

520 GOTO 220 

^^ Go back for another bunch of flips. 
A RUN might look like this. 



HOW MANY COIN FLIPS? 100 

I GOT 53 HEADS AND 47 TAILS. 

HOW MANY COIN FLIPS? 100 

I GOT 45 HEADS AND 55 TAILS. 

HOW MANY COIN FLIPS? 1000 

I GOT 505 HEADS AND 494 TAILS 



HOW MANY COIN FLIPS? 



and so on 



Remember. With this program, the PET is actually 
simulating the coin flips, but is not printing the 
result of each Hip. Instead, it counts the number of 
HEADS and the number of TAILS and, after doing 
the required number of ilips, prints the results. 
Exercise 9. Write a program to simulate flipping two 
coins. For a single toss, there are four possible out- 
comes. 
HH HT TH TT 

We show HT and TH as different outcomes, 

because — 

suppose we toss a nickel and a dime. The possible 

outcomes arc like this: 

NICKEL H H T T 

DIME H T H T 

^ \ \ \ 

HH HT TH TT 

Here is a RUN of our program to (lip two coins at a 
time. 



HOW MANY COIN FLIPS? 20 



HH 
HT 
TT 
TT 
TH 



TH 


TH 


HH 


TH 


TH 


TH 


TT 


TT 


HH 


HT 


READY 





TT 
HT 
TH 
HH 
HH 



Exercise 10. Instead of printing the results (HH or 
HT or TH or TT), count them. Write a program to 
flip two coins N times, then print the number of 
times they came up HH, HT, TH and TT. Below is 
a sample RUN, showing how we would like to see 
the results. 



HOW MANY COIN FLIPS? 1000 



OUTCOt-IE 
HH 
HT 
TH 
TT 

READY 



NUMBER OF TIMES 
243 
250 
259 
248 



Introducing 

the compact 
graphic printe 
that performs 
like the big 
guys. 

Only*450 

(plus shipping & handling) 



■"^xi^is^ 



Apple or 

Other 

interface 

available.. ^ 

S80 



jOmpad 
law, this nl 
GP 80 ■ Woodpecic 
gives yau an extra bonu 
usually reserved for 
regular-size printers . -. 
80 characters per tine! 

"Woodpecker" features an efficient uni-hammer printer head, 5x7 
matri)t, and was designed tor interface to Apple and others. It uses 
an econorny-weight. continuous-form paper and will make up to 
three copies (including the original). 

"Woodpeci(er's" mark set for sharp graphic reproduction and 
characterset for 128 character (alpha-numeric and symbols) print- 
ing give full printer capabilities. 

Call today for more information or to place your phone order' 
(415) 326-9100 • 39 Town & Country Village, Palo Alio, CA 94301 . 

We honor Master Charge, Vi$a, checli or mnnev order (California residents add 
e.S^b sales 13)1 ) 



^^ 5YSray/£ FORMULATE CORPORATION 



Keep Those Cords 
ond Letters Coming 

COMPUTE! 
Needs You! 

Address articles, programming notes 
and comments to: 

The Editor 

COMPUTE! 

P.O, Box 5406 

Greensboro, NC 27403 



Febiuary, 1981 Issue 9. 



COMPUTE! 



41 



Cyberia™ introduces two very practical additions for PET/CBIVI systems. 



SuRerBus 



Greatly - 
multiplies system 
capabilities 




$195 

per computer 



This is an active, integrated system— not just a 
passive networl<. SuperBus gives schools, banks, 
laboratories and businesses control of the way their 
networks operate. 

■ Up to 18 computers, disk drives or printers 
can be interconnected. 

■ Complete file security (program and data) 
and BASIC security. 

■ Built-in error detection and convenience features. 

■ Can both read and write to disk. 

■ All BASIC commands can be used. 

MasterCard, VISA and C.O.D. orders accepted. Specify N or B keyboard when orderin 
Visicalc is a trademark of Personal Soltware. Inc.: WordPro, ot Professional Software 



$49»^ 

per computer 



Auto-Boot automatically loads and runs the 
first program on disk (initializing if necessary). 

Completely compatible with WordProTw, 
CMSTM,Visicalc™ and most other programs. 

Automatically detects BASIC errors and 
causes last program to be loaded and run. 
Easily disabled, returning the computer to 
normal operation. 



^ 



: 515-292-7634 



2330 LINCOLN WAY, AMES, IOWA 50010 



ig SuperBus. Dealer inquiries invited. 
Inc.; and CMS, of CMS Software, Inc. 



32 K BYTE MEMORY 

RELIABLE AND COST EFFECTIVE RAM FOR 

6502 & 6800 BASED MICROCOMPUTERS 

AIM 65-*KIM*SYM 

PET*S44-BUS 



. PLUG COMPATIBLE WITH THE AIM 65/5VM EXPANSION 
COWNECTOR BY USiNG A RIGHT ANGLE CONNECTOR 
ISUPPLIEDI MOUNTED ON THE BACK Of THE MEMORY 
BOAflD 

. MEMORY BOARD EDGE CONNECTOR PLUGS INTO THE 
MOD S 4J BUS 

. CONNECTS TO PET OR KIM USING AN ADAPTOP CABLE 

• RELIABLE- DYNAMIC RAM WITH ON BOARD INVISIBLE 
REFRESH-LOOKS LIKE STATIC MEMORY BUT AT 
LOWER COST AND A FRACTION OF THE POWER 
REQUIRED FOR STATIC BOARDS 

• USES -SV ONLY. SUPPLIED FROM HOST COMPUTER, 

• FULL DOCUMENTATION ASSEMBLED AND TESTED 
BOARDS ARE GUARANTEED FOR ONE YEAR AND 
PURCHASE PRICE IS FULLY REFUNDABLE IF BOARD IS 
^cTURSED UNDAMAGED WITHIN 14 DAYS, 

ASSEMBLED WITH 32K RAM , ,. S395.00 

S WITH I6K RAM 5339,00 

TESTED WITHOUT RAM CHIPS S279 00 

HARD rO GET PABTS {NO RAM CHIPS) 
IMTH BOARD AND MANUAL S109 00 

BARE BOARD 4 MANUAL S49 00 



PET I NTEHFACE KIT-CONNECTS THE 32K RAM BOARD TO 
A 4K OR SK PET. CONTAINS: INTERFACE CABLE, BOARD 
STANDOFFS. POWER SIPPLV MODIFICATION KIT AND 
COMPLETE INSTRUCTIONS .-t49.M 







'.i-j-vjf^^f^^^ 



16K MEMORY 
EXPANSION KIT 



FOR APPLE, TRS-80 KEYBOARD. 
EXIDY, AND ALL OTHER 16K 
DYNAMIC SYSTEMS USING 
MK4116-3 OR EQUIVALENT 
DEVICES. 

* 200 NSEC ACCESS, 375 NSEC 
CYCLE 

+ BURNED-IN AND FULLY 
TESTED 

* 1 YR. PARTS REPLACEMENT 
GUARANTEE 

* OTY. DISCOUNTS AVAILABLE 



U.S. PRICES ONLY 



ALL ASSEMBLED BOARDS AND 
MEMORY CHIPS CARRY A FULL ONE 
YEAR REPLACEMENT WARRANTY 



COmPUTER DE\j\ces 

I230 UJ.COUinS RV€. 

ORFinGE, CA 9S668 

(714)633-7260 

CilK. midtnli pl<»> KM 1% »ln Ki. Muhrchirja 

& Vl» ftccAptfrd. PItM* ftllow 14 diyt for chKki to 
ar bank. Phofla ordtft WHCORM. Shipping chargH 

I ba adi^ad lo ill ahipmanu. 



42 



COMPUTE! 



February. 1931 Issue 9. 



Stat Lab 



A Wachtel 

The 2'" Exj)t'rimenta! design is a method to determine 
the effect of a number of parameters which influence 
the outcome of a process, as well as their interac- 
tions. The main effects arc considered independent 
from each other and orthogonal. For example, we 
wish lo determine the effects of temperature, 
pressure, and agitation on the yield of a chemical 
reaction, or we wish to determine the number of 
sales per month as a function of product quality, 
packaging, and the amount of advertising. Combin- 
ing each of the three parameters in all possible ways, 
we get 23 or 8 figures for yield or sales which are 
entered as DATA. The program employs Yale's 
algorithm which is simply a convenient mathematical 
method to arri\e at the results which are read honi 



the table which is produced. Suppose A = tempera- 
ture (A =high, - =low), B = pressure (B =high, 
- =low), and C = agitation (C =fast, - = slow or ab- 
sent), the EFFECT = denote the effects of each of 
these condition.s on yeild. Since EFFECT72^ = 
tnean square, this is essentially a k - way ANOVA. 
An estimate of the error usually obtains from the 
sum of mean squares of the interactions (normally 
low, i.e. noise). If then, we wish to determine the 
confidence level for some main effect, we divide its 
mean square by that of the error to arri\e at an F 
value. Replication of the experiment, i.e. obtaining 
two inputs for each condition is much better, because 
then we can obtain an inde])endent estiniale of the 
error from the differences between the replicates. 



8 GOTO 410 

10 REM £-K EftPERIHEHTflL DESIGN fl. UflC 
HTEL PITTSBURGH, PR 15235. 
£0 DIM KC3Zj/^<:3ey,Z<3£> 
30 N=0 

40 REfiD V:IF V=9S99 THEN 80 
50 N=N+1: I=H 

60 Y< I >=Y:X': I >=v<: I ;■ 

70 GOTO 40 

88 DEF FNRf M>- INK X* 1800+0. 5 >.-■ 1800 

90 K= I NTC LOG( N V-'LOG'; £ >+0 . 5 > 

100 FOR .1=1 TO K 

110 FOR 1 = 1 TO N,--e 

1£0 Zf I >=X<E*I )-t-rt<e*I-i > 

130 NEXT 1 

140 FOR I = N-'£+i TO N 

150 zi I >=Xi: £+<; i-H^'£ > )-K'; £*■: i-N'£ ?-i > 

160 NE>iT I 

170 FOR 1== 1 TO H 

1S9 XC I ')=Z(. I > 

190 PRIHT"LJ" 

£00 NEXT I: NEXT J 

£ 1 PR I NT " N " ; TRBf 6 :■ " Y " j TflBt 1 > " VRR I flBL 
ES " i THBs: £7 > " EST I KRTES " 

S£0 PRINT" ";TRE<5V' "jTRBkiOJ" 

" ; TRBC £7 > " " 

£30 PRINT 

£40 FOR N=0 TO £-'-K-i 

£.50 -J=N 

£60 IF J=0 THEN R*=" ptraN=" : D = £-'^K 

£70 IF .JO0 THEN R$=" EFFECT=" : D = £-'-K.-£ 

£30 FOR I=K-1 TO S STEP -i 

£90 KkK-1 >=INTtN^-£-"-I >:N=N-Kf K-I >*£'-I 

300 NEXT I 

310 PRINT J-i- 1 ; TRB< 4 > Yf J+ 1 > ; TRB< 1 ) ; 



3£e FOR I=K TO 1 STEP -1 

330 IF KC I ;'=0 THEN B*=" -" 

340 IF K<I>=1 THEN B*=" "+CHR$'; K-I+b5 ) 

350 PRINTBfj 

360 NEXT I 

370 PRINT TRBC £1 >RSjTRB<:30>FNR<XC J+i >.D 

380 N = .J 

390 NEXT H 

400 GOTO 540 

410 PR INT "L" 

4E0 PR I NT "THIS PROGRRM FINDS THE MRIH fl 
ND INTER-" 

430 PR I NT "ACT I ON EFFECTS OF K VRRIRBLES 

fijBj. . . " 

440 PRINT"IN ALL COMEINHTIONS BY YRTE'S 

ALGORITHM" 

450 PRINT" USE LINE 1 

RND " 

460 PRINT"HHY LINES UP TO 19 TO ENTER N 

DkTR, " 

470 PRINT"FOLLOWECJ BY 9999. H IS RLWRYS 

£'-K. " 

480 PRINT"<i6 DRTR < K=4 J WILL FIT ON TH 
E SCREEN > 

490 PRINT 

500 PRINT "THC DRTR CORRESPOND TO THE OB 
SERVRTIONS" 

510 PRIHT"OBTflINED WITH THE VRRIRBLES H 
IGH COR" 

5E0 PRIHT"PRESEHT>='R,B.. . 'OR LOy f OR fi 
BSENT >='-'. " 

530 PR I NT "TO REGRIN INSTRUCTIONS, TYPE 
RUN 410." 

540 END _. 

READY. ^ 



February. 1981. Issue 9, 



COMPUTE! 



43 



Computer House Division 

PROGRAMS FOR COMMODORE AND APPLE 
Legal accountfng Demo $15.00 

Legal accounting Program 995.00 

Machine Part Quote Demo 15.00 

Machine Part Quote Program 325.00 




Mailing/phone list 


80.00 


Political Mail/phone list 


130.00 


Beams, structural 


115.00 


Trig/Circle Tangent 


110.00 


Spur Gears 


35.00 


Bolt Circles 


25.00 


Filament Wound TAnks 


125.00 


Scrunch 


25,00 


PROGRAMS FOR COMMODORE ONLY 




A/P, A/R, Job Cost & Job Est. 


370.00 


Inventory 


95.00 


Financial 


175.00 


Real Estate Listings 


265.00 


Check Writer 


25.00 


File Editing Tools (FET) 


65.00 


Screen Dump/Repeat 


35.00 


Docu-Print 


20.00 


Scrunch 


25.00 


Sof-Bkup 


40.00 


Sorter (Mach. Language) 


35.00 


Trace-Print 


25.00 


Vari-Print 


25.00 



ASK FOR CATALOG #80-02 Dealers Wanted 
Computer House Div. 1407 Clinton Road 
Jackson, Michigan 49202 (517) 782-2132 




'appiG computer 

* Authorized Dealer 

FULL SELECTION OF APPLE 
COMPUTERS AND ACCESSORIES. 

. .^.^^,__- IN 

J$' CANADA 

For Personal - Business - Educational ap- 
plications and more, there's only one place 
to come for all your APPLE needs. 

OFF THE SHELF DELIVERY. 



HOUSE dF CnmPUTERS inc. 

368 EGLINTON AVE. W (at Avenue Re i 
TORONTO. ONTARIO MSN 1A2 




(416)482-4335 



y/^ APPLE II 

/ SOFTWARE FROM 

FaHVERSOFT 

P. O. BOX 157 

PITMAN, NEW JERSEY 08071 

(609) 589-5500 



SUPER CHECKBOOK 3.0— A vastly improvad version ol our popular 
selling program. With new features such as: simplified but powerful 
transaction entry and modilicalion routines, new reconciliation 
routines, additional features such as 30 percent increase in the total 
number of checks ttandled. posting of interest from interest bearing 
checking accounts, automatic teller transactions, bullet proof error 
handling, and smart disk routines. Plus the program still contains the 
options of bar graphs, sorting, actii/ities. and account status. 

Disk Only/Applesoft $34.95 

Of special interest to owners of older versions of the program is a 
limited trade-in period ending May 31. 1981. Trade-in value $19.95 
cassette S24,95 diskette. Original tape or diskette must be returned 
to receive new version plus SI .50 freight and the difference Ijetweer 
$34,95 and the trade-in value, A conversion program is included to 
convert data files to the new format. 

ADDRESS FILE GENERATOR-Allows the user to create any number 
of four types of address files: Holiday, Birthday. Home and Commer- 
ciai. The program contains a menu of seven major commands used 
to: Create. Add. Edit, Dispiay. Search, Sort, and Reorganize Files 
Up to three fields may be used for the sort criteria. Major commands 
have subordinate commands which adds to the flexibility of this 
powerful software system. We doubt you could buy a better program 

lor maintaining and printing address files Disk Only/ 

Apple Printer Card/ Applesoft $24.95 

SPANISH VOCABULARY DRILL 

FRENCH VOCABULARY DRILL 

ITALIAN VOCABULARY DRILL 
GERMAN VOCABULARY DRILL 

Tfiese programs provide practice in foreign language vocabulary by 
means of three types of drills: Malciiing, Foreign Language to English 
and English to Foreign Language. Although the disl<ette comes witti 
some lessons on it. these are intended to be samples. The most effec- 
tive way to use these programs is to enter your own lessons from the 
course you are studying. To facilitate the entry of new lessons, each 
program contains a complete Lesson Editor which has various entry 
and revision options. The manual also contains instructions for con- 
verting the programs to other languages Disk Only/ 

Applesoll each $24.95 

SPACE TREK J— Your mission is to patrol the galaxy, and to seek oul 
and destroy the ships of the Klarian fleet. At your command is the 
starship Lexington. The Lexington has a wide variety of weapons, 
sensors and other devices useful in your mission. There are two 
kinds of Klarian ships Regular and Super. Regular Klarians have an 
average energy supply of 5000 to 1 2000 quarks while Super Klarians 
have 1250010 15000 quarks and are protected from some of the Lex- 
ingtons' weapons and attack strategies Disk Only/ 

Applesoft $19.95 

WORLD OF ODYSSEY-An adventure game utilizing the full power of 
Disk II. which enables the player to explore 353 rooms on 6 different 
levels full of dragons, dwarfs, ores, goblins, gold and jewels. The 
program allows llie player to stop the game and to resume at a later 
time Disk Only/ Applesoft $24.95 

GALACTIC EMPIRES-Pits 1 to 20 players against each other and the 
computer in a struggle for control of up to 40 star systems. The 
players compete by sending out fleets of ships to capture neutral 
planets and to attack the colonies of other players. The victor is the 
player who controls the most stars by game's end. 

Applesoft $14.95 



Dealer Inquiries Invited— Visa and MasterCard 

M^a HVERSOFT 



Vpit 



p. O. BOX 157 
PITMAN, NEW JERSEY 0807 
(609) 589-5500 



07 ly 



Microcomputer Measurement And 
Control For PET,APPLE,KIM and AIM65 



^pDv rS TIP :r'^-^ 



6 

■It H allHiU 




The world we live in is full of variables we want to 
measure. These include weight, temperature, pressure, 
humidity, speed and fluid level. These variables arc 
contintious and their values may be represented by a 
voltage. This voltage is the analog of the physical 
variable. A device which converts a physical, 
mechanical or chemical quantity to a voltage is called 
a sensor. 

Computers do not understand voltages: They 
understand bits. Bits are digital signals. A device 
which converts voltages to bits is an analog-to-digital 
convener. Our AIM 16 (Analog Input Module) is a 16 
input analog-io-digital converter. 

The goal of Connecticut microcomputer in 
designing the uMAC SYSTEMS is to produce easy to 
use, low cost data acquisition and control modules for 
small computers. These acquisition and control 
modules will include digital input .sensing (e.g. 
switches), analog input sensing (e.g. temperature, 
humidity), digital output control (e.g. lamps, motors, 
alarms), and analog output control (e.g. X-Y plotters, 
or oscilloscopes). 

Connectors 

The AIM 16 requires connections to its input port 
(analog inputs) and its output port (computer inter- 
face). The ICON (Input CONnector) is a 20 pin, 
solder eyelet, edge connector for connecting inputs to 
each of the AlMI6's 16 channels, The OCON (Output 
CONnector) is a 20 pin, solder eyelet edge connector 
for connecting the computer's input and output ports 
to the AIM 16. 

The MANMODI {MANifold MODule) replaces 
the ICON. It has screw terminals and barrier strips for 
all 16 inputs for connecting pots, joysticks, voltage 
sources, etc. 

CABLE A24 (24 inch interconnect cable) has an 
interface connector on one end and an OCON 
equivalent on the other. This cable provides connec- 
tions between the uM.ACSYSTEMS computer inter- 
faces and the Al.M 16 or XPANDRl and between the 
XPANDRl and up to eight AIM I65. 




Analog Input Module . 

The AIM 16 is a 16 channel analog to digital converter 
designed to work with most microcomputers. The 
AIM 16 is conneclcd to the host computer through the 
computer's 8 bit input port and 8 bit output port, or 
through one of the uMAC SYSTEMS special inter- 
faces. 

The input voltage range is to 5.12 volts. The in- 
put voltage is converted to a count between and 255 
(00 and FF hex). Resolution is 20 millivolts per count. 
Accuracy is 0.5% ± 1 bit. Conversion time is less 
than 100 microseconds per channel. All 16 channels 
can be scanned in less than 1.5 milliseconds. 

Power requirements are 12 volts DC at 60 ma. 

POWl 

The POWl is the power module for the AIM16. One 
POWl supplies enough power for one AIM16, one 
MANMODI, si.xtcen sensors, one XPANDRl and one 
computer interface. The POWl comes in an American 
version (POWIa) for 1 10 VAC and in a European ver- 
sion (POWle) for 230 VAC. 



TEMPSENS 



This module provides two temperature probes for use 
bv the AIMI6. This module should be used with the 
MANMODI for ease of hookup. The MANMODI 
will support up to 16 probes (eight TEMPSENS 
modules). Resolution for each probe is I'F. 





Remote Controller- 
Clock and Calendar 

AN INEXPENSIVE CONTROL 
SOLUTION FOR 
HOME SECURITY • ENERGY CON- 
SERVATION • GREENHOUSES 

• ENVIRONMENTAL CONTROL 

• INDUSTRIAL CONTROL 

• LABORATORIES 

SUPER X-10 MOD SPECS 

1. Remote controller 

Controls up to 256 different remote devices by sen- 
ding signals over Ihe house wiring to remote 
modules. Uses BSR remote modules available all 
over the USA (Sears, Radio Shack, etc). Does not 
require BSR control module. Docs not use sonic 
link. 

2. Clock/calendar 

Time of day - hours, minutes, seconds 
Date - month, day - automatically corrects for 
2S,29,30 and 31 day months. Day of the week. 
3- Digital input/outputs 

8 inputs - TTL levels or switch closures, 

Can be used as a trigger t'or a stored 

sequence. 
8 outputs - TTL levels 

Power supply included IIOV.AC only. 

XPANDRl 

The XPANDRl allows up to eight Inpul/Outpul 
modules to be connected to a computer ai one time. 
The XPANDRl is connected to the computer in place 
of the AIM 16 or XIO MOD, Up to eight AIM 16s or 
seven Aim 16s and one XIO MOD .ire then connected 
to each of the eight ports provided using a C.'^BLE 
A24 for each module. 



For your convenience the AIM 16 and the XIO MOD come as part of a number of 
sets. The minimum conliguraiion for a usable system is the .AIM 16 Starter Set 1 
which includes one AIM 16, one POWl, one ICON and one OCON. The .AIM16 
Starter Set 2 includes a M.^NMODl in place of the ICON. The minimum configura- 
tion for a usable system is the XIO MOD Starter Set which includes one X 10 MOD. 



one ICON and one OCON. These sets require that you have ;i hardware knowledge 
of your computer and of computer interfacing. 

For simple plug compatible systems we also offer computer interfaces and sets 
for many computers. 



A1MI6 179.00 

SUPER XIO MOD (1 10 VAC only) 249.«l 

PO W 1 a ( POWer module- IIOVAC) 14,95 

POWle (POWermodule-230 VAC) 24.95 

ICON (Input CONnector) 9.95 

OCON (Output CONnector) 9.<>5 

MANMODI (MANifold MODule) 59.95 

CABLE A24 (24 inch interconnect 

cable) 19-« 

XPANDRl (allows up (o 8 Input or 
Output modules 10 be connected to a 

computer at one time) 59.95 

TEMPSENS2P1 (two temperature probes, 

-10°F to 160°F) 69.95 

LIGHTSENSIPI (light ieve! probe) 89.95 

The following sets include one AIM 16, 
one POWl, one OCON and one ICON. 

ALMI6 Starter Set la (1 10 VAC) 189.00 

AIM16 Starter Set le (230 VAC) 199.00 

All prices and spKificalions subject to change without 
notice. Our lOnday monc>' back guarantee applies. 



The following sets include one AIMI6, 

one POWl, one OCON and one MANMODI, 

AIMI6 Starter Set 2a (1 10 VAC) 239.00 

AIM16 Starter Set 2e (230 VAC) 249.00 

The following modules plug into their respective 
computers and, when used with a CABLE A24, 
eliminate the need for custom wiring of the computer 
interface. 

PET.MOD (Commodore PET) 49.95 

KIMMOD (KIM,SYM) 39.95 

APMOD (APPLE 11) S9.95 

TRS-80 MOD (Radio Shack TRS-80) 59.9S 

A1M65 MOD (AIM 65) 39.95 

The following sets include one AIMI6, one POWl, one 
MAN.MODl , one CABLE A24 and one computer inter- 
face module 
PETSETla (Commodore PET - 

1 10 VAC) 295.00 

PETSETle (Commodore PET - 

230 VAC) 305.00 



KIMSETI.1 (KIM,SYM,AIM65 - 

1 10 VAC) 285.00 

KlMSETle (KIM,SYM,A1M65 - 

230 VAC) 295.00 

APSETla( APPLE 11-110 VAC) 295.00 

APSETle(APPLE 11-230 VAC) 305.00 

TRS-80 SETIa (Radio Shack TRS-SO ■ 

1 10 VAC) 295.00 

TRS-80 SETle(Radio Shack TRS-80 - 

230 VAC) 305.00 

AIM65 SETla(AlM65-l 10 VAC) 2S5.00 

AIM65 SETIe(AIM65-230 VAC) 295.00 

The following sets include one .\10 MOD. one 
CABLE .A24, one ICON and one computer interface 
module. 

PETSET2(Commadore PET) 295.00 

KIMSET2(KIM,SYM) 285.00 

APSET2(APPLE II) 295.00 

TRS-80 SET2 (Radio Shack TRS-80) 295.00 

AIM65 SET2 (AIM65) 285.00 

SUPER XIO MOD/XPANDRl SET2 (if you already 
have a SETI) 295. IMI 



Printer And Communication Interfaces For Tiie CBM/PET 




SADI For Serial 

Two-way 

Communication, 

Parallel 

Printers, 

and Serial 

Printers 



ADA1600 • For Parallel NEC 
and Centronics Standard Printers 



SADl - The microprocessor based serial and parallel interface for the 
Conimodore PET. SADl allows you to connect your PET lo parallel 
and serial printers, CRT's, modems, acoustic couplers, hard copy ter- 
minals and other computers. The serial and parallel ports arc indepen- 
dent allowing (he PET lo contmunicate with both peripheral devices 
simuUaneoiisly or one at a time. In addition, the RS-232 device can 
communicate with the parallel device. 
Special Features for the PET interface include: 

Conversion to true .^SCIl both in and out 

Cursor controls and function characters specially printed 

Selectable reversal of upper and lower case 

Addressable * works with other devices 
Special Features for the serial interface include: 

Baud rate selectable from 75 to 9600 

Half or full duplex 

32 character buffer 

X-ON, X-OFF automatically sent 

Selectable carriage return delay 
Special Features for the parallel interface Include: 

Data strobe - either polarity 

Device ready - either polarity 

Centronics compatible 
Complete with power supply, PET IEEE cable, RS-232 connector, 
parallel port connector and case. Assembled and tested. 

SADIa (llOVAC) S295 

SADle (230VAC) S325 



The ADAI6(X) is a low cost easy to use interface for the Conimodorc Computers. It allows the PET and CBM computers to use standard Centronics type printers (in- 
cluding the NEC 5530) for improved quality printing. The ADAI600 has a two foot cable which plugs into the PET IEEE port. Another IEEE card edge connector is 
provided for connecting disks and other peripherals to the PET. The .AD.A1600 is addressable and does not tie up the bus. The address is switch selectable. A four foot 
cable with a standard 36 pin Centronics connector is provided. A switch selects upper/lower case, upper/lower case reversed (needed for some Commodore machines) 
and upper case only for clearer program listings. Works with WORDPRO, BASIC and other software. No special programming is required. The case measures 3 1/2 x 
5 3/4 inches. Comes complete, assembled and tested, with case and cables. Power is obtained from the printer or an external power suppiv mav be used. Retail price 
for the ADAieOOis S129. 



ADA1450 • Serial Printer Adapters 



The ADA1450 is a low cost, ea.sv to use serial interface for the Commodore Computers. It allows the PET and CBM computers to use standard serial printers Tor irn- 
proved qualiiv printing The AD'A1450 has a two foot cable which plugs into the PET IEEE port. Another IEEE card edge connector is provided for connectmg disks 
and other peripherals to the PET. The ADA1450 is addressable and does not tie up the bus. The address is switch selectable. A six foot RS-232 cable is provided wuh a 
DB25 connector. Pin 3 is data out. Pins 5,6 and 8 act as readv lines to the printer. Pins 4 and 20 act as ready lines from the printer. These lines can be switched for 
non-standard printers. Baud rate is selectable to 9600 baud. A switch selects upper/lower case, upper/lower case reversed (needed for some Commodore machines) and 
upper case only for clearer program listings. Works with WORDPRO, BASIC and other software. No special programmmg is required. The case measures 3 l'2 x 5 
3/4 inches. Comes complete, assembled and tested, with case, cables, power supply and software on cassette for graphmg lunctions, lormatting data etc, The ADA14S0 
has a female DB25 connector at the end of the RS-232 cable for most standard printers. The ADA145I)N has a male DB25 at the end of the RS-232 cable for the 
DIABLO serial printers. Retail price for the ADA1450 or I450N is S139. 

ADA730 Parallel • For the Centronics 730 and 737 Printers 

The ADA730 is a low cost easy to use interface for the Commodore Computers. It allows the PET and CBM computers lo use Centronics type 730 and 737 printers. 
The ADA730 has a two foot cable which plugs into the PET IEEE port. .Another IEEE card edge connector is provided for connecting disks and other peripherals to 
the PET. The ADA7'30 is addressable and docs not tie up the bus. The address is switch selectable. A cable with a 36 pin card edge connector is provided. A switch 
selects upper/lower coase, uppcr/Iowcr case reversed (needed for some Commodore machines) and upper case only for clearer program listings. Works with WORD- 
PRO, BASIC and other software. No special programming is required. The case measures 3 1/2 .\ 5 3/4 inches. Comes complete, assembled and tested, with case and 
cables. Powxt is obtained from the printer or an external power supply may be used. Retail price for the ADA is S129. 



S 131 



SOFTWARE 

Word 
prao»u<"' 

rroBr*"* 




QUANTITY DESCRIPTION PRICE TOTAL 



Word Processor 
Program • 

PET Word Processor. On tape - 

S39.50, On disk - 49.50 

For 8K Pets 29.50 

For 16k and 32K Pels 39.50 

Compose and print letters, flyers, 

ads, manuscripts, etc. Uses disk or 

tape. 30 page manual included. 



SUBTOTAL 



Handling and shipping — add per order 



S3.00 



Foreign orders add 10% for AIR postage 



Conn, residents add 7'?ii sales ta.\ 



TOTAL ENCLOSED 



• 


# i' 


■ 


M,f^. 


^w 


9r- 




1 


« 


k ADA400 


■4 


Y, 


I RS-232 


■ i 




1 To Current 


g' 


m 


I Loop 


r 


m 

• 


Adapter 



NAME 

COMPANY 
ADDRESS 



CITY _ 
STATE . 



VISA O M/C O Expiration date. 
Card number 



.ZIP. 



Mention this magazine and deduct 2H'o from the TOTAL 



RS-232 to current loop adapter (ADA 400). ADA4O05 - Solder Pads 24.50 

S29.50 ,'\DA400B - Barrier Strips with screw 

Two circuits - 1 each direction. Run an RS-232 terminals 29.50 
device off a computer's teletype port or vice 
versa. Optoisoialed. 

In the US order from: Connecticut Microcomputer, Inc. 
34 Del Mar Drive Brookfield, CT 06804 (203) 775-4595 
In Canada order from: Batteries Included, LTD 
71 McCaul St. F6 Toronto, Canada M5T2X1 (416)596-1405 




Connecticut microcomputer, Inc. 

34 Del Wlar Drive, Brookfield, CT 06804 
203 775-4595 TWX; 710 456-0052 



46 



COMPUTE! 



February. 1981. Issue 9 



A BCD to 
Floating-Point 
Binary Routine 

Marvin L, De Jong 

Departnnent of Mathematics-Physics 

The School of the Ozarks 

Pt. Lookout. MO 65726 

Introduction 

The principal purpose of this article is to provide the 
reader with a program that converts a BCD number 
(ASCII representation) with a decimal point and/or 
an exponent to a floating-point binary number. The 
floating-point l^inary number has a mantissa of 32 
bits, an exponent byte consisting of a sign bit and 
seven magnitude bits, and a sign flag (one byte) for 
the mantissa. Positive and negative numbers whose 
magnitudes vary from 1.70141183*10-^^ to 
I.4693679.')*10-39 and zero can be handled by this 
routine. In subsequent articles I hope to provide an 
output routine and a four-function arithmetic 
routine. The routine described here could be used in 
conjunction with the Am9511 Arithmetic Processing 
Unit ' to perform a large variety of arithmetic func- 
tions. 

Floating-Point Notation 

Integer arithmetic is relatively simple to do with the 
6502. Consult the Bibliography for a number of 
sources of information on muliiplc-byte, signed 
number addition, subtraction, multiplication and 
division. Scanlon's book, in particular, has some 
valuable assembly language routines of this sort. 
However, additional problems arise when the 
decimal number has a fractional part, such as the 
"14159" in the number 3.14159. Also, integer 
arithmetic is not suitable ibr handling large numbers 
like 2.3*10 , The solution is to convert decimal 
numbers to floating-point binary numbers. A binary 
floating-point number consists of a mantissa with an 
implied binary point just to the left of the most- 
significant non-zero bit and an exponent (or 
characteristic) that contains the information about 
where the binary point must be moved to represent 
the number correctly. Readers who are familiar with 
scientific notation will understand this quickly. 
Scanlon's book has a good section on floating-point 
notation. We will merely illustrate what a decimal 
number becomes in floating point binary by referring 
you to Table 1 . The dashed line over a sequence of 
digits means that they repeat. For examples, 1/3 = 
.33 and 1/11 = .090'90 = .090 while a bina ry exam- 
ple is 1/1010 = .00011001100 = .0001100. 



Table 1. Decimal number to floating-point binary con- 
versions, 

FLOATING 
BINARY POINT 
NUMBER NUMBER NOTATION MANTISS.^ EXPONENT 

X 2" 

1 1 .1X2* 1 1 

2 10 .1X22 1 10 



4 100 .1X2-' 1 H 

1.5 1.1 .11x2! 11 1 

0.75 .11 . 11 X 2^ n 

0.1 O.OOOIIOOIIOO .1100X2"-* 1100 -11 

31 11111 .11111X2^ 11111 101 

32 100000 100000 1 110 

A close examination of Table 1 yields some impor- 
tant conclusions. Unless a number is an integer 
power of two (2'^ where n is an integer), the mantissa 
required to correctly represent the number will re- 
quire more bits as the numbers increase. Thus, the 
number 1 can be correctly represented with a one-bit 
mantissa, but the number 31 requires a five-bit man- 
tissa. A n-bit mantissa can correctly represent a 
number as large as 2" - 1, but no larger. There is 
another problem associated with numbers like O.l^gj^ 
that become repealing numbers in binary. It should be 
clear that no mantissa with a/inite number of bits 
can represent 0. 1 exactly. The fact that computers use 
a finite number of bits to represent numbers like 0. 1 
can be illustrated by using BASIC to add 0.1 to a 
sum and print the answer repeatedly. Starting with a 
sum of zero, we obtained an answer of 3.6 after 36 
times through the loop, but the next answer is 
3.69999999 which is clearly incorrect. The error in- 
curred by using a finite number of bits, to represent 
a number that requires more than that number of 
bits to correctly represent it, is called roundoff error. 

How many bits shoifld be used for the mantissa? 
Clearly it should be an integer number of bytes for 
ease in programming. Some computers have software 
packages that use a 24 bit mantissa. The largest 
number that can be represented by 24 bits is 2^^ -I 
= 16777215, This represents about seven decimal 
digits, giving about six digit accuracy afier several 
calculations. With my salary there is no trouble with 
six digit accuracy, but many financial calculations re- 
quire accuracy to the nearest cent, and six digits are 
frequently not enough. If we choose 32 bits for our 
mantissa size we get a little more than nine digits 
(4.3 X 10^). This is the mantissa size used in several 
versions of Microsofl BASIC, and it is the size 
chosen here. The propagation of round-off errors 
through ihe calculations normally gives about eight 
digit accuracy. It is generally true that the roundoff 
errors accumulate as the number of calculations to 
find a specific result increases, but this is a subject 
beyond the scope of this article. 

How big should (he exponent be? If we choose 
to represent the binary exponent with one byte then 
we will have seven bits to represent the exponent 
(one sign bit and seven magnitude bits). The largest 



-;:3sit^.-^i :i - 



i?3^^ 



i^^ 







***** ***** ****** ***** **«•** 
**************************** *' 

•••♦*•**••*•••*«»***•**••••• * 

• ** *•* **« *** *** *** **• •** *' 

;** *i* *** ****** ****** •** • 
*** *** *** *** *** *** *** * 
*** *** *** •** *** *** «** *•* *••«*• 
*** *** *** •** *** *** *** *** *** 
:!**«•* ******* ******* .**•*•* •••*•*• 
******* ******* ******* ******* ******* 
***** ***** **•**• ***** ••**•* 




Photo credit: GREAT GALAXY IN ANDROMEDA: Palomar Observatory, Catifornia Institute of Technology 
THE MTU FLOPPY DISK CONTROLLER WITH 16K RAM GIVES YOUR AIM-65 ION DRIVE POWER! 



HARDWARE 

16K 2 PORT RAM ONBOARD WITH WRITE PROTECT 
■ USES THE NEC-765 DISK CONTROLLER CHIP 
• ROM BOOTSTRAP LOADER SPEEDS LOADING 
' DMA OPERATION ALLOWS INTERRUPTS 
> SUPPORTS 8 INCH DRIVES 1 OR 2 SIDED 
' MAXIMUM STORAGE IS 4 MEGABYTES 
' ANALOG PLL DATA SEPERATOR 

SYSTEM FEATURES 

' FORMAT UTILITY LOGS OUT DEFECTIVE SECTORS 
DISK/FILE COPY WITH WILDCARD SELECTION 
SYSTEM CUSTOMIZATION UTILITY 
VISIBLE MEMORY TERMINAL DRIVER PROVIDED 
INTERCHANGE CODOS SOFTWARE 
AMONG KIM, SYM, AIM, PET SYSTEMS 
IN FIELD USE FOR OVER 6 MONTHS 



CODOS SOFTWARE 

• CODOS DISK OPERATING SOFTWARE 

• 8K RAM RESIDENT ALLOWS UPGRADES 

• FINDS AND LOADS 32K BYTES IN 3 SECONDS 

• STARTUP FILE EXECUTES AT BOOT-UP 

• COMMAND FILE EXECUTION FROM DISK 

• DYNAMIC DISK STORAGE ALLOCATION 

• DEVICE-INDEPENDENT I/O 

• TRUE RANDOM ACCESS TO RECORD IN ONE ACCESS 

• MONITOR WITH 29 BUILT-IN COMMANDS 

• FULL ENGLISH ERROR MESSAGES 

. FILE NAMES 12 CHARACTERS -^ EXTENSIONS 

• FILE SIZE UP TO 1 MEGABYTE 

• UP TO 247 FILES PER DISK DRIVE 
INDIVIDUAL WRITE PROTECT ON FILES 
WORKS WITH AIM EDITOR. ASSEMBLER, 
BASIC AND MONITOR ROMS 

• SUPERVISOR CALLS AVAILABLE TO USER PROGRAM 



K-1013M Hardware Manual-$10, K-1013-3M CODOS manual-$25. K-1013-3D RAM/Disk controller with CODOS- $595, Floppy 
drives, cables, power supply also available. 

MASTERCARD & VISA accepted 

WRITE OR CALL TODAY FOR OUR 48 PAGE FALL 1980 CATALOG DESCRIBING ALL MTU 6502 PRODUCTS, INCLUDING 
320 BY 200 GRAPHICS, AIM GRAPHIC/TEXT PRINT SOFTWARE, BANK-SWITCH ABLE RAM/ROM/l-0, AIM CARD FILE, 
POWER SUPPLY AND MORE! 



Micro Technology Unlimited • 2806 Hillsborough St. • RO. Box 12106 • Raleigh. N.C. 27605 • (919)833-1458 



COMPUTE! 



February. 198). Issue 5. 



exponent is then +127. If all the bits in the mantissa 

are ones, then the largest number that can be 
represented is (1/2 + 1/4 + 1/8 + 1/16 +....+ 
l/2-'^)*2'*', which is approximately 
1.70141183*10-^8. The smallest exponent is -128. 
The smallest positive number that the mantissa can be 
is 1/2, thus the smallest positive number that can be 
represented is 2"^29 which is approximately 
1.46936795*10-39. Of course, if we chose to use two 
bytes for the exponent then much larger and smaller 
exponents could be accommodated, but for most 
calculations by earth people, a range of lO'^Q {„ iq38 
will do quite nicely. Remember that if you try to 
enter a number whose absolute value is outside of the 
range just given (except for zero) you will obtain er- 
roneous results. No overflow or underflow messages 
arc given when entering numbers with this routine. 
One more note before turning to the program. 
The mantissa is said to be normalized when it is 
shifted so that the mosi-significanl bit is one, and the 
binary point is assumed to be to the left of the most- 
significant bit. The only exception to this is the 
number zero which is represented by zeros in both 
the mantissa and the exponent. Although you are 
free to assume the binary point is some other place in 
the mantissa, it is conventional to keep it to the left 
of the mantissa, as illustrated in Table 1. 



The Program To Float A Number 

The program in Listing 1 , written in the form of a 
subroutine, together with the other subroutines given 
in the listings, will accept numbers represented by 
ASCII from an input device and convert the 
numbers into their floating point representation. A 
typical entry might be -i- 12.3456789E -i-24 or 
-•.123456789E-30. The plus sign is optional since the 
computer simply disregards it. Up to 12 significant 
digits may be entered, although the least-significant 
three will soon be disregarded, leaving approximately 
9 decimal digits (32 binary digits). At the completion 
of the routine, the floating-point representation will 
be found in locations 10001, $0002, S0003, $0004 
(mantissa), S0005 (exponent) and location $0007 con- 
tains the sign of the mantissa. The sign byte is SFF if 
the number is negative, otherwise it is SOO. Note that 
the accumulator (locations $0001-80004) has not 
been complemented in the case of a minus number. 
Forming the twos complement may be done, when 
required, by the arithmetic routines. If a format 
compatible with the Am9511 Arithmetic Processing 
Unit is required, simply drop the least-significant 
byte of the mantissa ($0004), put the sign (set the bit 
for a minus, clear it for a plus) in bit seven of the ex- 
ponent ($0005) and shift the sign of the exponent 
from bit seven to bit six, making sure to keep the 
rest of the exponent intact. Table 2 gives a summary 
of the important memory locations. 



Tabic 2. Memory assignments for the BCD to floating- 
point binary routine, 

50000 = OVFLO; overflow byte for the accumulator when it 
is shifted left or multiplied by ten. 

50001 ^ MSB; most-significant byte of the accumulator. 
$0002 = NMSB; next-most-significant byte of the ac- 
cumulator. 

50003 = NLSB; ncxt-least-significant byte of the ac- 
cumulator. 

50004 = LSB; least-significant byte of the accumulator. 

50005 = BEXP; contains the binary exponent, bit seven is 
the sign bit. 

SOOOtJ = CHAR; used to store the character input from the 
keyboard. 

50007 = MFLAG; set to $FF when a minus sign is entered. 

50008 = DPFLAG; decimal point flag, set when decimal 
point is entered. 

SOOOA = ESIGN; set to SFF when a minus sign is entered for 

the exponent. 

SOOOB = TEMP; temporary storage location. 

SOOOC = EVAL; value of the decimal exponent entered after 

the "E." 

S0017 = DEXP; current value of the decimal exponent. 

After clearing alt of the memory locations that wiU be 
used by routine, the program in Listing 1 jumps to a 
subroutine at $0F9B. Most users will not want to call 
this subroutine, since it merely serves to clear the 
AIM 65 display. Subroutine INPUT, called next, 
must be supplied by the user. It must get a BCD 
digit represented in ASCII code from some input 
device, store it in CHAR at $0006, and return to the 
calling program with the ASCII character in the 
6502's accumulator. The necessary subroutines for 
the AIM 65 are given in Listing 4. They are given in 
the "K" disassembly format with no comments since 
they have previously been described by De Jong^. 
Ottr subroutines input the number on the keyboard 
and echo the number on the printer and the display. 

The algorithm for the conversion routine was 
obtained from an article by Hashizume-'. If you are 
interested in more details regarding floating-point 
arithmetic routines, please consult his fine article. A 
flow chart of the routine in Listing 1 is given in 
Figure 1. The flow chart and the program comments 
should be sufficient explanation. Basically it works by 
converting the number, as it is being entered, to 
binary and multiplying by ten, in binary of course. 
Later, if and when the exponent is entered, the 
number is cither multiplied cjr divided by ten, in 
binary, to get a normalized mantissa and an expo- 
nent representing a power of two rather than a power 
of ten. Each time a multiplication or division by ten 
occurs the mantissa is renormalized and rounded up- 
ward il the most-significani discarded bit is one. 
Each normalization adjusts the binary exponent. 
When the decimal exponent finally reaches zero no 
more multiplications or divisions are necessary since 
10^ = 1. To maintain 32-bit precision, an extra 
byte, called OVFLO, is used in the accuinulator for 
all *10 and /lO operations. 



-ebruarv, 1981 Issue 9 



COMPUTE! 



BAHERY BACKUP FOR PET/CBM 



TM 



BACKPACK 

Designed to install within the CPU Case, BACKPACK gives 
6 to 1 minutes of full power to the computer (32K, CRT, 
Tape Driue) during times of powershortages and gliches in 
power lines thus allowing the user time enough to save data 
or programs to tape (or disk with FLOPPY BACKPACK). 
Batteries are recharged from CPU's own power supply and 
BACKPACK requires no wiring changes to install 

Single Quanity $225.00 

AIM-65 POWER SUPPLY (with 

AIM POWER 4™ 

AIM POWER 4 is a total power supply witli lechargeable 
hattery backup for the Rockwell AIM 65. AIM POWER 4 
supplies full voltage output for the AIM under normal 
operating mode and with batteries can keep the Al IVI up and 
mnning for one hour. Batteries are recharged during nor- 
mal operation. AIM POWER 4 is on a single board and will 
mount inside tiie AME 1 enclosure (from ETC), and Enclo- 
sure Group Products. 

Single Quanity $250.00 



FLOPPY BACKPACK 



TM 



FLOPPY BACKPACK is a battery backup system for the 
Commodore Dual Floppy Disk Drive. Used in conjunction 
with BACKPACK for the pet, the user can save data and 
programs during power shortages. It also eliminates possible 
disk crashes. Designed to install within the disk cabinet with 
no wiring changes, the batteries are recharged from the disk's 
own power supply. 

Single Quanity 3135.00 

battery backup) & ENCLOSURE 

AME 1™ 

AME 1 is a totally metal enclosure of lightweight aluminum 
construction. Designed to house the Al M B5 and a power 
supply, with easy access to switches and connectors. AWIE 1 
will have an integral reset button, easy paper feed and totally 
visible 20 character LED readout. Designed for industrial 
applications, but has professional appearance. 

Single Quanily SI 00.00 



FOR MORE II^IFORWIATION OR TO ORDER BY PHONE: (919) 3624200 OR (919) 3G2-5B71 
INCLUDE $5.00 FOR SHIPPING AND HANDLING • VISA AND MASTERCHARGE ACCEPTED 

DEALER INQUIRIES INVITED 



Ail Products are shipped fully assembled and .■..■^~. 
Ready to Install ■ Instructions included. 5*^&i 



P.O. Box G, Apex, North Carolina 27502 
(919) 3624200 



Etcetera International Software 




THE ELECTRONIC COLUMNAR PAD 



and 



A Problem Solving 
Computer Software Program 



COLUPAD"^'^ is a unique computer tool which allows you to create, store, selectiueiy retriBve and perform math 
operations upon data and then generate reports using that data. COLUPADti^ can best be visualized as the typical 
columnar accounting pad found in most offices. Powerful, but simple to use, COLUPAQ"^'^ has such features as: 

• 24 columns and 40 rows for data manipulation 

• Space for row aid column descriptions 

• Ability 10 reference decimal places for each column 

• Ability to perform math functions on one column and store in another 

• Ability to add, subtract, multiply, etc., one column lo another and then 
place resultitig data in a different column 

• Print a Wiole page, selective coluniie or rows 

• Save whole page to disk 
Retneve whole pages, selective rows, or columns from disk 

• Plus much, much more 

One page of the pad, the worksheet, is in computer memory. Ttie pad consists of worksheets stored on disk and linked by name. Pad 
size is only limited to diskette capacity. 

If you find yourself spending hours (or days) copying, adding, subtracting, or whatever one column by another or just compiling data on 
a columnar pad, then COLUPAD^" can save you time, and in your business, time is money. COLUPAD "^" requires a 32K PET, Disk, 
and printer. -SI 50.00 

FOR MORE INFORWIATION OR TO ORDER BY PHONE: (919) 3624200 OR (319) 362-5671 
INCLUDE 31.50 FOR SHIPPING AND HAiyDLING • VISA AND MASTERCHARGE ACCEPTED 
DEALER INQUIRIES INVITED 



P.O. BOX G, APEX, NORfTH CAROLINA 27502 (919) 362-4200 






50 



COMPUTE! 



February, 19B1- Issue 9 



REFERENCES 

1. 15c Jong, Murviu L., "Inlerfacing the Ain9.Tll Arilhinclic 

Processing Uiiii," COMPUTE' II. (in press). 

2. Dcjong, Marvin L., "An AIM 65 Notepad," MICRO, No. 

16, Scpi. 1979, p. 11. 

3. Hasliizunie, Burt, "l-'Ioaling Point Arithint-lic," BYTE, 

V 2, No. 11, Nov. 1977, p. 76. 

BIBLIOGRAPHY 

1. Programming and Interfacing the 6502, With Experiments, 

Marvin L. De Jong, Howard W. Sams & Co,, 
Itulianapolis, 19fiO. 

2. 6502 Assembly Language Programming, Lance A. 

Levemhal, OsbuniV/McGraw-Hill, Berkeley, 1979. 

3. 6502 Software Design, Leo J. Seanlnii, Howanl \V. Sams 

& Co., Indianapolis, 1980. 



Listing 1. ASCII to Floating-Point Binary Conversion 
Program 



Decimal mode not required 
Clear ali the memory loca- 
tions used for storage by 
thi.5 routine by loading 
thcin with zeros. 



Clears AIM 65 display. 
Get ASCII representation of 
BCD digit. Is il a + sign? 
Yes, get another character. 
Is it a minus sign? 

Yes, set minus flag to $FF. 
Get the next character. 
Is character a decimal 
point? 

No. Perhaps it is a digit. 
Yes, check flag. 
Was the decimal point flag 
set? 

Time to normalize the 
mantissa. 

Set decimal point Hag, 
and get the next character. 
Is the character a digit? 
No, then normalize the 
mantissa. 

Digits have ASCII repre- 
sentations between S30 
and 139. 

It was a digit, so multiply 
the accumulator hy ten and 
add the new digit. First 
strip the ASCII prefix by 
subtracting S30, 
Add the new digit to the 
least- significant byte 
of the accumulator. 
Next, any "carry" will be 
added to the other bytes of 
the accumulator. 

Add carry here. 
And save result. 

The new digit has been 

added. 

Check the decimal point 

nag. 

If not set. get another 

character. 

If set, decrement tlie 

exponent, then get another 

character. 

Normalize the mantissa. 



tOEOO D8 START 


CLD 


OEOl A2 20 


LDX S20 


0E03 A9 00 


LDA SOO 


OE05 95 00 CLEAR 


STA MEM.X 


0E07 CA 


DEX 


0E08 10 FB 


BPL CLEAR 


OEOA 20 9B OF 


JSR CLDISP 


OEOD 20 30 OF 


JSR INPUT 


OEIO C9 2B 


CMP $2B 


0E12 FO 06 


BEQPLUS 


0EI4 09 2D 


CMP S2D 


0E16 DO 05 


BNE NTMNS 


0E18 C6 07 


DEC MFLAG 


OEIA 20 30 OF PLUS 


JSR INPUT 


OEID 09 2E NTMNS 


CMP i2E 


OEIF DO 08 


BNE DIGIT 


0E21 A5 08 


LDA DPFLAG 


OE23 DO 2C 


BNE NORMIZ 


OE25 E6 OB 


INC DPFLAG 


0E27 DO Fl 


BNE PLUS 


OE29 C9 30 DIGIT 


CMP $30 


0E2B 90 24 


BCC NORMIZ 


0E2D C9 3A 


CMP J3A 


0E2F BO 20 


BCS NORMIZ 


0E31 20 00 OD 


JSR TENX 


0E34 A5 06 


LDA CHAR 


0E36 38 


SEC 


0E37 E9 30 


SBC S30 


OE39 18 


CLC 


0E3A 65 04 


ADC LSB 


0E3C 85 04 


STA LSB 


0E3E A2 03 


LDX $03 


$0E40 A9 00 ADDIG 


LDA $00 


0E42 75 00 


ADC ACC,X 


0E44 95 00 


STA ACCX 


0E46 CA 


DEX 


0E47 10 F7 


BPL ADDIG 


0E49 A5 08 


LDA DPFLAG 


0E4B FO CD 


BEQ PLUS 


0E4D C6 17 


DEC DEXP 


0E4F 30 C9 


BMI PLUS 



0E54 84 OB 
0E56 A9 20 

0E58 38 
0E59 E5 OB 
0E5B 85 05 

0E5D A5 01 
0E5F FO 5A 
0E61 A5 06 
0E63 C9 45 



0E65 DO 52 
0EG7 20 30 OF 
0E6A C9 2B 
0E6C FO 06 

0E6E C9 2D 
0E70 DO 05 

0E72 C6 OA 

0E74 20 30 OF PAST 

0E77C9 30 NUMB 

0E79 90 3E 

0E7B C9 3A 

0E7D BO 3A 

0E7F 38 

S0E80 £9 30 

0E82 85 OB 
0E84 20 30 OF 
0E87 C9 30 
0E89 90 13 
0E8B C9 3A 
0E8D BO OF 
OEBF 38 
0E90 E9 30 

0E92 85 OC 

0E94 A5 OB 
0E96 OA 

0E97 OA 

0E98 18 
0E9y 65 OB 

0E9B OA 



0E9C 85 OB 
OESE 18 
0E9F A5 OB 
OEAl 65 OC 
0EA3 85 OC 
0EA5 A5 OA 

0EA7 FO 09 
0EA9 A5 OC 
OEAB 49 FF 
OEAD 38 

OEAE 69 00 
OEBO 85 OC 

0EB2 18 
0EB3 A5 OC 
0EB5 65 17 

0EB7 85 17 



HERE 



POS'l V 



STY TEMP Save Y. It contained the 

LDA S20 number of "left shifts" in 

NORM. 

The binarj' exponent is 32 - 
number of left shifts that 
NORM took to make the 
most-significant bit one. 
If the MSB of the accumu- 
lator is zerc^, then the 
number is zero, and its all 
over. Otherwise, check if 
the last character was an 
"E". 

BNE TENPRWir not, miivr (o TENPRW. 

JSR INPUT If so, get another character. 
Is it a plus:' 
Yes, then i^cl another 
character. 

Perhaps il was a minus? 
No, then maybe it was a 
number. 

Set exponent sign flag. 
Get another character. 
Is it a digit? 

BCC TENPRWNo, more to TENPRW. 

CMP $3A 

BCS TENPRW 

SEC 



SEC 

SBC TEMP 

STA BEXP 

LDA MSB 
BEQ FINISH 
LDA CHAR 
CMP J45 



CMP $2B 
BEQ PAST 

CMP S2D 

BNE NUMP 

DEC ESIGN 
JSR INPUT 

CMP $30 



SBC $30 
STA TEMP 
JSR INPUT 
CMP $30 
BCC HERE 
CMP $3A 
BCS HERE 
SEC 
SBC $30 

STA EVAL 

LDA TEMP 
ASL A 

ASL A 

CLC 

ADC TEMP 

ASL A 

STA TEMP 
CLC 

LDA TEMP 
ADC EVAL 
STA EVAL 
LDA ESIGN 

BEQ POSTV 
LDA EVAL 
EOR $FF 

SEC 

ADC $00 
STA EVAL 

CLC 

LDA EVAL 

ADC DEXP 

STA DEXP 



It was a digit, so strip 
ASCII prefix. 
ASCII prefix is $30. 
Keep the first digit here. 
Get another character. 
Is it a digit? 

No. Then ficiish handling 
the exponent. 

Yes. Decimal exponent is 

new digit plus 10 times the 

old digit. 

Strip .4SCI1 prefix 

from new digit. 

Get the old character and 

multiply it by ten. First 

times two. 

Times two again makes 

times four. 

Added to itself makes times 

five. 

Times two again makes 

times ten. 

Store it. 

Add the new digit, 

to the exponent. 
Here is the exponent, 
except for ils sign. Was 
it a negative? 

No. 

Yes, then form ils twos 
eomplenTenI by complemen- 
tation follo\*'etl b)' adding 
one. 

Result into exponent value 

location. 

Prepare to add exponents. 

Gel "E" exponent. 

Add exponenl from input 

and norm. 

All exponent work finished. 



0E5I 20 30 OD NORMIZJSR NORM 



$0EB9 A5 17 TENPRWLDA DEXP Get decimal exponent. 
OEBB FO 71 BEQ FINISH If it is zero, routine is 

done 
OEBD 10 61 BPL MLTPLY Ir it is pluv, go multiply by 

ten. 
OEBF A2 03 ONCMORLDX $03 It's minus. Divide by ten. 

OECl 06 04 BACK ASL LSB First shift the accumulator 



Februory, 1981 Issue 9. 



COMPUTE! 



51 



0EC3 26 03 
0EC5 26 02 
0EC7 26 01 
0EC9 26 00 
OECB C6 05 
OECD CA 
OECE DO Fl 
OEDO AO 20 
0ED2 06 04 
0ED4 26 03 

0ED6 26 02 
OEDB 26 01 
OEDA 26 00 
OEDC 88 
OEDD FO OE 
OEDF A5 00 

OEEl 38 
0EE2 E9 OA 
0EE4 30 EC 

0EE6 85 00 
0EE8 E6 04 

OEEA 18 
OEEB 90 E5 
DEED A5 00 
OEEF C9 OA 

OEFl 90 15 
0EF3 A2 04 
$0EF5 B5 00 
0EF7 69 00 
0EF9 95 00 
OEFB CA 
OEFC DO F7 
OEFE 90 08 
OFOO A5 01 
0F02 09 80 

QF04 85 01 
0FO6 E6 05 

OF08 A5 01 
OFOA 30 OA 
OFOC 06 04 
OFOE 2G 03 

OFIO 26 02 
0F12 26 01 
0F14 C6 05 

0F16 AS 00 
0F18 85 00 
OFIA E6 17 
OFIC DO Al 
OFIE FO OE 

0F20 A9 00 
nF22 85 00 
0F24 20 00 OD 

0F27 20 30 OD 

0F2A C6 17 
0F2C DO F6 
0F2E 60 



HOL NLSB 
ROL NMSB 
ROL MSB 
ROL OVFLO 
DEC BEXP 
DEX 

BNE BACK 
LDY $20 
AGAIN ASL LSB 

ROL NLSB 

ROL NMSB 
ROL MSB 
ROL OVFLO 
DEY 

BEQOUT 
LDA OVFLO 

SEC 

SBC $0A 
BMI AGAIN 

STA OVFLO 

INC LSB 

CLC 

BCC AGAIN 
OUT LDA OVFLO 
CMP (OA 

BCC AHEAD 
LDX S04 
REPET LDA ACC.X 
ADC SOO 
STA ACC.X 
DEX 

BNE REPET 
BCC AHEAD 
LDA MSB 
ORA J80 

STA MSB 
INC BEXP 

AHEAD LDA MSB 
BMI ARND 
ASL LSB 
ROL NLSB 

ROL NMSB 
ROL MSB 
DEC BEXP 

ARND LDA SOO 

STA OVFLO 

INC DEXP For each dividc-bj-10, 
BNE ONCMOR increment the decimal cx- 
BEQ FINISH ponent until it is zero. 
Then its all over. 
Clear overflow byte. 



three bits left. 



Decrease the binary 
exponent for each left shift. 

Number of trial divisions 
of $0A into the accumu- 
lator giving a $20 = 32 
bit quotient. 



Get out when number of 

trial divisions reaches 

$20 = 32. 

Subtract 10 = $0A from 

partial dividcnt in OVFLO. 

If result is minus, zero into 

quotient 

Otherwise store result in 

OVFLO, and set bit to one 

in quotient. 

Try it again. 

Check once more to see if 
quotient should be rounded 
upwards. 
No. 

Yes. Add one to quotient. 
Get each byte of the accu- 
mulator and add the carry 
from the previous addition. 



What if carry from accumu- 
lator occurred? Get most- 
significant byte and put a 1 
in bit seven. 
Result into high byte, 
and increment the binary 
exponent. 

Because of three-bit shift at 
start of division, a one-bit 
shift (at most) may be re- 
quired to normalize the 
mantissa now. 



If so, also decrement binary 

exponent. 

Clear overflow byte. 



MLTPLY LDA $00 

STA OVFLO 
STLPLS JSR TENX 

JSR NORM 

DEC DEXP 
BNE STLPLS 
FINISH RTS 



Jump to multiply-by-ten 
subroutine. 
Then normalize the 
mantissa. 

For each multiply-by- 10, 
decrement the decimal ex- 
ponent until it's icro. All 
finished now. 



Listing 2. Multiply 
SODOO 18 TENX 
ODOl A2 04 
0D03 B5 00 BRl 

000.5 2A 
0D06 95 10 

0D08 CA 
0D09 10 F8 

ODOB A2 04 
ODOD 18 



by Ten Subroutine. 

CLC Shift accuniulattir left. 

LDX $04 Accumulator contains 

LDA ACC.X four bytes so X is set to 
four. 

ROL A Shift a byte left. 

STA ACCB,XStort it iu accumula- 
tor B. 

DEX 

BPL BRl 



ODOE 36 10 
ODIO CA 
ODll 10 FB 
0D13 A2 04 
0D1.5 18 

0D16 B5 OO 
0D18 75 10 
ODIA 95 00 
ODIC CA 
ODID 10 ¥7 
ODIF A2 04 
0D21 18 

0D22 36 00 
0D24 CA 
0D2.T 10 FB 
0D27 60 



BR2 



BR3 



Back to get another 

byte. 

Now shift accumulator B 

left once again to get 

"times four." 

ROL ACCB,XShift one byte left. 

DEX 

Back to get another byte. 
Add accumulator to 
accumulator B to get 
A + 4'A = 5*A. 

LDA ACC.X 

ADCACCB^ 

STA ACC.X Result into accumulator. 

DEX 

BPL BR3 

LDX S04 

CLC 



LDX $04 
CLC 



BPL BR2 

LDX S04 
CLC 



Finally, shift accumula- 
tor left one bit to get 
2*5'A = lO'A. 



BR4 



ROL ACC,X 
DEX 
BPL BR4 
RTS 



Get another byte. 



r 



WANT YOUR COMPUTER BACK?" 



TM 



Microcomputer (MMC) take over any 



Let the MICROsport 
dedicated task. 

It is Ihc affordable alternative - kits from S89.00, application 
units from only SI 19.00 (assembled and tested). 

It is user-oriented - complete in-circuit emulation allows pro- 
gram development on ANY 6502 based system. It is compact 
(4Vi" X 6'/2" pe board) but powerful (32 I/O lines; 20 mA full 
duplex, IK RAM + EPROM socket 4/16 bit counters; 6503 
CPU) and works off any AC or DC power supply. 

Turn your present 6502 based system into a complete develop- 
ment system with: 

I MMC/03D Microcomputer with ZIF sockets 
1 MMC/03 1 CE In-circuit emulator for the 6503 CPU 
1 MMC/03EPA EPROM Programmer complete with software 
driver. 




For more info call or write 

R. J. BRACHMAN ASSOCIATES, INC 

P.O. Box 1077 

Haverlown. PA 19083 

(215)622-5495 



52 



COMPUTE! 



February. 1981. Issue P 



Listing 3. Normalize the 
SOD 30 18 NORM CLC 

OD 3 1 A5 00 BR6 
0D33 FO OF 



0D35 46 00 
0D37 66 01 
0D39 66 02 
0D3B 66 03 
0D3D 66 04 
0D3F E6 05 

0D41 B8 
0D42 50 Ed 
0D44 90 OD BR5 
0D46 A2 04 
0D48 B5 00 BR8 
0D4A 69 00 

0D4C 95 00 
0D4E CA 
0D4F 10 F7 
0D51 30 DE 

0D53 AO 00 BR7 



Mantissa Subroutine. 



LDA OVFLO 


BEQ BR5 


LSR OVFLO 


ROR MSB 


ROR NMSB 


ROR NLSB 


ROR LSB 


INC BEXP 


CLV 


BVC BR6 


BCC BR7 


LDX S04 


LDA ACC.X 


ADC SOO 


STA ACC,X 


DEX 


BPL BR8 


BMI BR6 



LDY $00 



0D55 A5 01 


BRIO 


LDA MSB 


OD57 30 OD 




BMI BRll 


0D59 18 




CLC 


ODjA A2 04 




LDX S04 


0D5C 36 00 


BR9 


ROL ACCX 


0D5E CA 




DEX 


0D5F DO FB 




BNE BR9 


0D61 C8 




INY 


0D62 CO 20 




CPY $20 


0D64 90 EF 




BCC BRIO 


0D66 60 


BRll 


RTS 



Any bits set in the over- 
flow byte? Yes, then 
rotate right. 
No, then rotate left. 



For each shift right, 

increment binary 

exponent. 

Force a jump back. 

Did the last rotate cause 
a carry? Yes. tlicn round 
the mantissa upward. 
Carry is set so one is 
added 



Check overflow byte 

once more. 

Y will count number of 

left shifts. 

Docs most-significant 

byte have a one in bit 

seven? Yes, get out. 

No. Then shift the 

accumulator left one bit. 



Keep track of left slilfts. 
Not more than S20 = 32 
bits. 

That's it. 



DISK DRIVE WOES? PRIMER INTERACTION? 
MEMORY LOSS? ERRATIC OPERATION? 

DON'T BLAME THE SOFTWARE! 




ISO-1 




lSO-2 



Power Line Spikes, Surges & Hash could be the culprit! 
Floppies, printers, memory a processor often interact! 
Our unique ISOLATORS eliminate equipment interaction 
AND C'jrb damaging Power Line fp.kes. Surges and Hash. 
♦ISOLATOR I ISO! A) 3 filter isolatec' 3 prong sockets; 
integral Surge/Spike Suppression; 1875 W Maximum load, 

1 KW load any socket S56-95 

•ISOLATOR (iSOZt 2 filter isolated 3-prong socket banks; 

(6 sockets total); ifiteyal Spike/Surge Suppression; 

1875 W Max load, 1 KW either bank SB6.95 

•SUPER ISOLATOR (ISO-3). similar to ISO-IA 

except double filtering & Suppression .... $85.95 

•ISOLATOR (lSO-4), similar to ISO 1 A except 

unit tias 6 individually filtered sockets .... $96.95 

'ISOLATOR (ISOS), similar to ISO-2 except 

unit has 3 socket banks, 9 sockets total . . . $79.95 

•CIRCUIT BREAKER, any model (add-CB) Add $ 7.00 

•CKTBRKR/SWITCH/PILOT (CBS) . . . -Add $14.00 

TOLL FREE ORDER DESK 1-800-225-4876 ■«■■; 

(EkopI Ml. HI. Ak. Pf. CmodB) mSmm 

/S^ Electronic Specialists, Inc. 

171 South Miin Siteel. Nilick, M«ss 01760 Dept. CT 

TECHNICAL & NON-800 AREAS 1-617-655-1532 



Listing 4. AIM 65 
S0F30 20 JSll E93C 
0F33 20 JSR FOOO 
0F36 85 STA 06 
0F3B 20 JSR OF72 
0F3B 20 JSR 0F60 
0F3E Aj LDA 0(. 
OF-fO SO RTS 

S0F85 A2 LDX #12 
0F87 BD LDA A438,X 
OFSA E8 INX 
0F8B 9D STA A438.X 
0F8E CA DEX 
UFBF CA DEX 
0F9O 10 BPL 0F87 
0F92 A9 LDA i>20 
0F94 3D STA .A43B 
0F97 20 JST OF(iO 
OFyA CORTS 



Input/Output Subroutines. 

SOFtJO A2 LDX #13 SOF72 HD STA A44C 
0FC2 8A TXA 0F75 A2 LDX *01 

0F63 48 PHA OF77 BD LDA A438.X 

0FG4 BD LDA A438,X0F7A CA DEX 
0F(i7 09 ORA #80 0F7B 9D .STA A438,X 

0F(i9 20JSK EF7B 0F7E FB INX 
0F7F KH INX 



OFfiC 68 PLA 
OFfiD AA TAX 
OFGE CA DEX 
0F6F 10 BPL 0F62 
0F71 BO RTS 

S0F9B A2 LDX *13 
0F9D A9 LDA "!20 
0F9F yD STA A438,X 
0FA2 CA DEX 
0F.-\3 10 BPL 0F9F 
OFA;> ()0 RTS 



0F80 EO CPX #15 
0F82 90 BCC OF77 
0F84 60 RTS 




1) . .^( ( u r 



i(( fitp^ Ae:r 

IM H1MI;NT 

\n.\r 




l)M|.| l\UM 
i| I \i-nM M 




^^H^l^^^l 
i-MHvr [ IIIH 
r n K . N> v» 
4 M^Hkl [I H 



Figure 1. A Flow Chart for the BCD to 
Floating-Point Binary Routine. 



Februafy. 1981. Issue 9 



COMPUTE! 



OMEGA "WHOLESALE COMPUTER PRICES" 
SALES DIRECT TO THE PUBLIC 

CO. 12 Meeting St., Cumberland, RI 02864 




Iniertcc Superlirainl 

I' aaK Ram $2449 

64K Ram $2649 



PRODUCT SPECIAL 

of the MONTH!! 




NEC spinwriler 
S510-5M0 S2449 




Apple II 16K $ 949 
4BK$1099 





EpwnMXBQ $599'| 




Atari 800 ■ $769 




Televideo ^ 

, 912 B or C - »699 fc^ 

920 C - '769 r* 



Products arc 

NOW 

IN 

STOCK 

AT 

QMEGA 

Sales 

Co. 



Diablo 630 
n995 

^2195 (with tractor feed) 



Centronics 
(limited quantities- 
call for auailability) 
779-11 ' 749 

704-9 '1500 

730-3 » 599 

737-1 » 699 



OMEGA OFFERS THE BEST DELIVERY AND PRICE ON: 
APPLE • ATARI • TRS-80 Model It • INTERTEC • 

DIABLO • EPSON • HEWLETT-PACKARD • SOROC • 
COMMODORE • NEC • QUME • CENTRONICS 



CALL TOLL FREE FOR OMEGA'S PRICE! 

1-800-556-7586 



OMEGA sells only quality rmerchandise to our customers. 
OMEGA will try to match any current advertised price with similar purchase conditions. 

Before you buy anywhere else — be sure to call QMEGA Sales Co. 

1-401-722- 1027 



OMEGA "A member in aood standing of the better business bureau 



OMEGA ships via UPS, truck, or air. COD's. 
Visa, Mastercharge accepted, with no service charge. 



54 



COMPUTE! 



FebFuary. 1981 Issue 9 



Editor's Note: Jim Lowell comimmti in his cover letter: 
"The program is aimed tit parents, elementary level math 
teachers, and anjone who wants to brush up on basic: math 
skills. I developed it to aid one of my children who has a 
learning disability. It succeeded in hulding his attention over 
the recommended one-half hour work periods and in eventually 
improving his skills. " 

Basic Math 
For Fun And 
Profit 

J.R Lowell, 
Whitehouse Station, NJ 

"Basic Math For Fun And Profit" is an 8K elemen- 
tary arithmetic program written ibr the 16K PET 
with new ROMs, It makes broad use of the PET's 
non-destructive cursor, excellent graphics, and pro- 
grammable sound (with a suitable amplifier). 

Though there are many basic math programs 
available today, each has its own particular short- 
comings. One variety treats only a single math mode 
(addition or subtraction or multiplication or division) 
in each program. A second may offer all modes in a 
single program, but randomly choose the level of dif- 
ficulty for the problems. Others force large numbers 
of problems in one mode before allowing a new mode 
to be chosen. 

Program Feature Overview 

"Basic Math For Fun And Profit" not only over- 
comes these problems, it also provides a whole host 
of unique features which make it both easy and fun 
to use: 

Menu selection for the four math modes; 
Icvcl-of-difficulty selection in each mode; 
mode and level change opportunity every 10 pro- 
blems; 

right-to-left entry of answer (just like on paper); 
Two chances, with prompts, per problem; 
sound effects for prompts and rewards; 
randomly generated reward statements; 
graphics reward for 10 out of 10 correct answers; 
first-name personalization throughout program. 
Let's look at the program features in more detail. 

Math Mode And Skill Level Selection 

After entering his or her name, the program gives 
the user a menu choice of the four math modes. As 
soon as a choice is entered (using a "GET" state- 
ment), the computer asks for the desired skill level; 
one to four digits in the problems. 



Problem Sets And Prompts 
(addition, subtraction, multiplication) 

The computer now generates — one at a lime — 10 
randomly configured problems in the chosen mode. 
The program uses two random problem generators: 
lines 269-293 for all modes except division and lines 
294-316 for division. 

Once an answer is entered and RETURN 
pushed, the computer either rewards or prompts the 
user. The reward is a pulsing laser-type sound effect 
plus one of four randomly selected "a(ta-a-person" 
statements. The prompts, like the rewards, have two 
parts that are mutually reinforcing. If the user's 
answer is too low a low tone is generated followed by 
a statement to the same effect. A high tone and state- 
ment follows too large an answer. In the case of a 
wrong answer, the program gives a second chance. A 
correct answer now receives the same reward as an 
initial right answer; a second error gets the ap- 
propriate "too high/low" sound and statciiu:nt 
followed by the correct answer. The computer then 
generates a new problem. 

Problem Sets And Prompts (Division) 

As above, the computer generates 10 ])roblems at 
the desired skill level. The prompt system, however, 
is a bit different because each division problem has 
two parts: the quotient and the remainder. When the 
quotient is too high, too low, or correct, the same 
sounds and statements are generated as in the other 
modes. If the quotient is correct, but the remainder 
is wrong, however, a new set of high/low .sounds and 
statements is given. As above, a second chance is 
provided before the correct answer is given. 
Answer Format And Correction 
The sub-routine in lines 907-931 is included to make 
the program as compatible with paper and pencil 
math as possible. It allows the user to enter his or 
her answers from right to left as is taught in most 
math clas.ses. As long as the RETURN key isn't 
pressed, the answer can be corrected. This routine 
makes full use of (he PET's GET and STRING 
capabilities. 

In division pr-oblems the quotient and remainder 
an.swers arc entered separately to allow for individual 
corrections. 

Problem Set Scores And The Ultimate Reward 
After each problem set, the computer gives the 
number correct and asks if the user wants another set 
of problems. If the answer is "yes", the program 
again presents the menu. If the answer is "no", the 
program thanks the user and ENDs. 

If the user has achieved a perfect score — 10 out 
of 10 — (he PET goes "wild": the screen goes 
blank; a siren sounds; the screen then announces in 
3-D letters, "WOW 10." As above, (he user can 
then choose whether or not to continue with a nevv 
problem set. 




educational software f rOm MlcrO-Ed 

We specialize in programs with these features: 

• Instructional lessons end with a summary of student • They have been written by professional educators, 
performance. Our main author is Thorwald Esbensen, named in 

1980 as one of North America's top school executives 

• Our programs are attractive and motivating to j^^ Executive Educator magazine, 
students. 

• Our tapes are independent modules, each one a 

• We will gladly replace any tape that fails to load or j-on^ipig^g lesson in itself, 
run properly. 



Unless otherwise specified, each tape can be 
purchased for 7.95 



You may wish to order tapes by the MICRODOZEN. Any twelve S7.95 tapes can be 

purchased for $84.00. 



PKT is (he reyisiertd liatit'- 
miirk fur ComiiioilDri' Hiisi- 
ri (' s s Machines. S n n i ii 
Cliira, CA. 



Send for free catalogue: 

MICRO-ED, Inc. • P.O. Box 24156 • Minneapolis, MN 55424 
or telephone us at (612) 926-2292 



All [jroijrnms work uith any 
8K PHI. old or new. 



54 



COMPUTE! 



February. 1981 Issue 9. 



Minus And Pluses 

First the minus. If you decide to type up this pro- 
gram, you have about five solid hours of work ahead 
of you (including debugging any slips in digital dex- 
terity you might make). On the other hand, 
however, I believe, if you have a need for a really 
good, complete basic math program, the work will be 
more than worth it. The major pluses are: 

Kids love the program. Compared with the drudgery 
of paper work alone, the "whistles and bells" provid- 
ed by this program make math fun. 

Kids like the personalization of both the instructions 
and rewards. 

Even mistakes aren't too painful to the user since 
both sound effects and written prompts are provided 
to help. 

In a one-half hour session, the user can work in 
several modes at different levels (avoiding the 
boredom of unchanging masses of single mode pro- 
blems). 

And last, but not least, if you belong (o a computer 
club, you'll be a hero for providing the membership 
with one of the best basic math programs available 
for the PET, 

Happy typing, and for your kids, happy learning. 

1 PRINT "R 

2 REM BASIC MATH FOR FUN AND PROFIT - -, 

-.JIM LOWELL 3/23/80. PLEASE WRITE -. 
-nP.O BOX 

3 REM 364, WHITEHOUSE STATION, N. J. -, 

-.08889 WITH QUESTIONS OR COMMENTS. 

4 PRINT: PRINT: PRINT "-l—/*H—/*-H-/*+-/*+-/* 

-,+_/*4_/ *+_/*+_/*+_ 

5 PRINT: PRINT:PRINT SPC(5) "BASIC MATH -. 

-.FOR FUN AND PROFIT" 

6 PRINT: PRINT:PRINT"h-/*-h-/*+-/*+-/*+-/* 

-.-H-/ * + -/ *-H- */-!— */-!-- 

7 PRINT: PRINT: PRINT" -i 

-iBY JIM LOWELL 

8 FOR I = 1 TO 5000:NEXT: PRINT "R": 

-.GOTO 50 

9 PRINT"fi 

10 PRINT" 

11 PRINT" 15 _ii -§ £i IS 

12 PRINT" il Mi E HM MAtl M IM H 

13 PRINT" MEi MMH MilM IMM 

14 PRINT" ILH lENE MMMIM-. 

15 PRINT" JiA 1 ^& &£,&&&&& && ' S 

16 PRINT" M i $&& &&'' && &&$ ' k 

17 PRINT" kk M && &&''&& &£M: &. 

18 PRINT" Ml M N&S &&' ' && &&M MM i 

19 PRINT" Ml im B. Sf. &&' ' && £■& M MM & 

-•k 

20 PRINT" MM kk Lk N&&N#M&&M && kii.Jik 

-•k 

21 PRINT" Rfif;&&&&&S&N &&&&&&& M&S&&&&&&& 

-^k 



5 $$SSS 
U M M 
&£ &&&&&R, 
kk kk %&& 
kk kk %&& 
kk kk %&.{. . 
kk kk Mk 
kk &&$%&& 
kk && M&& 
kk &SfS&&& 



22 PRINT" 

23 PRINT" 

24 PRINT" 

25 PRINT" 

26 PRINT" 

27 PRINT" 

28 PRINT" 

29 PRINT" 

30 PRINT" 

31 PRINT" 

32 PRINT"" 
34 PRINT" GOOD FOR YOU, ";A$ 

37 FOR N= 1 TO 70:RR= INT ( 5 D*RND (1 ) -1-50) ; 

-.POKE59466,0:POKE 59464, RR: 
-.POKE 59467,16 

38 POKE 59466, 15:F0R NN=1 TO 3:NEXT: 

-.POKE 59467, 0:NEXT 

40 PRINT"E":S=0 

41 GOTO 487 

50 PRINT;PRINT:PRINT:PRINT"PLEASE TYPE -n 

-.IN YOUR FIRST NAME" 
60 PRINT: INPUT"AND PRESS THE 'RETURN' -. 

-.KEY", -AS 
65 PRINT "R 

70 PRINT:PRINT:PRINT"THANK YOU, ";A$ 
75 FOR X=l TO 2000:NEXT:PRINT"fi 
80 PRINT:PRINT 
90 PRINT"OK ";AS;", NOW I WILL CREATE ^ 

-.SPECIAL" 
100 PRINT ;PRINT"HATH PROBLEMS JUST FOR -. 

-.YOU. I WILL" 
105 PRINT :PRINT"HELP YOU LEARN HOW TO -i 

-.ADD, SUBTRACT," 
110 PRINT: PRINT"MULTIPLY AND DIVIDE. IF - 

-.WE WORK FOR 1/2" 
130 PRINT:PRINT"HOUR AT A TIME, IT WILL - 

nBE MORE LIKE" 
133 PRINT: PRINT "FUN THAN WORK.": PRINT 

135 PRINT"PRESS ANY KEY TO START" 

136 GET C?:IF CS="" THEN 136 

139 PRINT"R 

140 PRINT:PRINT 

141 PRINT"MAKE A CHOICE NOW PLEASE." 

142 PRINT:PRINT"TYPE THE NUMBER OF THE -. 

-hKIND" 

143 PRINT :PRINT"OF PROBLEMS YOU WANT.": 

-.PRINT 
146 PRINT:PRINT" 1 = ADDITION" : PRINT 
148 PRINT:PRINT" 2 = SUBTRACTION": 

-.PRINT 
150 PRINT:PRINT" 3 = DIVISION ": PRINT 
152 PRINT: PRINT" 4 = MULTIPLICATION" 

-.: PRINT 

165 GET GS:IF G$="" GOTO 165 

166 IF G$<"1" OR G$>"4" THEN GOTO 165 

167 PRINT"fi 

168 G=VAL{G$) 

170 ON G GOTO 180,190,200,210 

180 PRINT"FINE ";A$;", NOW I WILL GIVE -, 

-.YOU 10" 

181 PRINT: PRINT "rADDITIONf PROBLEMS.": 

-nFOR X=l TO 4000:MEXT:PRINT"R 

182 PRINT:PRINT:PRINT"IF YOU HISS A -. 

-.PROBLEM, I WILL GIVE" 

183 PRINT :PRINT"YOU A HINT TO HELP YOU. - 

-. THEN YOU'LL" 

184 PRINT ;PRINT"HAVE ONE MORE CHANCE -. 

-nBEFORE I GIVE" 

185 PRINT :PRINT"YOU THE RIGHT ANSWER.": 

-.FOR T=l TO 10000:NEXT 



February, 1981. issue 9. 



COMPUTE! 



57 



ECX 

COMPUTER 

CO. 

Specialists 

In Commodore 
PET Equipment, 

Peripherals 
And Software. 

' All Commodore Business Machines Co. Products 

• ClOl: Centronics/NEC to lEEE-488 (PET) 

Interface $225.00 

• C102: Watanabc Digiplot to lEEE-488 (PET) 
Interface - $295.00 

• C232: IEEE-488 (PET) To RS-232C Bi- Directional Inter- 
face S Call 

• X232: PET To RS232C Bi-Directional Interface $ Call 

• Watanabe "Digiplot" Intelligent Graphics 

Plotter $1200.00 

• Curve: Graphics Software Package For The Digiplot 
And Pet $295.00 

• SX-100: IEEE-488 Modem Software (For Commodore 
Model 8010) $ 35.00 

• MX-200: Custom Parity IEEE-488 Modem With SX-200 
Software $449.95 

• PET Computer System Desk, Walnut or Oak . . . $395.00 

• NEC Spin writer Printer Stand: Matches Desk Noted 
Above $275.00 

We Offer Fast And Efficient Service On 
All Commodore Business Machines 
Equipment I 

Send it to us and you will have it back 

usually within a week! 

ECX Computer Co. is owned and operated 

by Com>Plications Inc., a design and 

development corporation specializing in 

IEEE-488 (PET) peripherals and software. 

Call Us: We Talk Technical! 

All Com-Plications Inc. peripherals are 

manufactured to industrial quality standards. 

If you want to know more about the IEEE-488 
Bus, read our new book, published by Osborne/ 
McGraw-Hill, "The Pet And The IEEE-488 (GPIB) 
Bus". Authored by the president of Com-PIications 
Inc. and available from us for $20.00 (includes tax and 
shipping). 

P.S. All of our IEEE-488 interfaces meet "all" the 
specifications of IEEE-488. 

ECX COMPUTER COMPANY 
2678 North Main Street #6 —-— 
Walnut Creek, CA. 94596 
(415) 944-9277 



HARD WORKING SOFTWARE 

TM 

for PET/CBM operating systems 1,0 to 3.0 

TM 

MATRIC expands Commodore BASIC with fourteen new 
commands for handling arrays. Algebraic style syntax. 
Checks for conformability. Extended error messages. 

The 5K machine language program lets you --Display a 
matrix on the screen and change its values. Transfer data 
between matrices or fill a matrix with a constant. Transpose. 
Transfer diagonals between matrices, or from a matrix to a 
vector, from a vector to a matrix, or fill a diagonal with a con- 
stant. Do vector or matrix addition, subtraction, multiplica- 
tion; elementwise multiplication, division, squares, and 
square roots. Inversion. Determinant. Eigenvalues and 
eigenvectors of a square, symmetric matrix. 

Specify size and ROM set of your machine. Tape or disk, 
32-page manual. Price: $125. 

TM 

PRO-GRESS multiple regression BASIC program reads 
unlimited records from tapes or CBM disk. Up to 45 variables 
in 32K. Permits transformations. Provides means, standard 
deviations, correlations; R, R-square, F, degrees of freedom; 
constant and coefficients, betas. Student's t's. Output to 
screen, or to ASCII or CBM printer. 

Manual and two programs. Tape: $45. Disk: $50. 

TM 

TEXTCAST II SK machme language word processor. Easy 

typing and screen editing. Produces ASCII files on tapes or 

disks. Prints with ASCII or CBM printer. Centers, underlines, 

right justifies, numbers pages. Creates data files for 

PRO-GRESS. 

Old/New ROM versions of program, revised manual. Tape: 

S75. Disk: S80. 

ORDER YOUR WORKERWARE FROM: ^ 

Cognitive Products 

P.O. Box 2592 

Chapel Hill. NC 27514 



Computer House Division 



PROGRAMS FOR COMMODORE AND APPLE 


Legal accounting Demo 


$15,00 


Legal accounting Program 


995.00 


Machine Part Quote Demo 


15.00 


Machine Pari Quote Program 


325.00 


Mailing/phone list 


80.00 


Political Mail/phone list 


130.00 


Beams, structural 


115.00 


Trig/Circle Tangent 


110.00 


Spur Gears 


35.00 


Boll Circles 


25.00 


Filannent Wound TAni^s 


125.00 


Scrunch 


25.00 


PROGRAMS FOR COMMODORE ONLY 


A/P, A/R, Job Cost & Job Est. 


370.00 


Inventory 


95.00 


Financial 


175,00 


Real Estate Listings 


265.00 


Check Writer 


25.00 


File Editing Tools (FET) 


65.00 


Screen Dump/Repeat 


35.00 


Docu-Print 


20.00 


Scrunch 


25.00 


Sof-Bkup 


40.00 


SQrter{Mach. Language) 


35.00 


Trace-Print 


25,00 


Vari-Print 


25.00 



ASK FOR CATALOG #80-C2 Dealers Wanted 
Computer House Div. 1407 Clinton Road 
Jackson, Michigan 49202 (517)782-2132 



58 



COMPUTE! 



February, 1981 Issue 9 



186 GOSUB 220 

187 IF G03 THEN 270tREM GO TO PROBLEM - 

-.GENERATOR 

188 GOTO 294: REM PROBLEM GENERATOR FOR - 

-.DIVISION ONLY 
190 PRINT"OK ";A$;", rSUBTRACTIONf IT -. 
tIS":F0R X=1TO40 00:NEXT:PRINT"R": 
-.GOTO 182 
200 PRINT"ALRIGHT ";A$;", THIS TIME -. 

-.WE'LL TRY" 
205 PRINT:PRINT"xDIVISION rPROBLEMS.": 
-.FOR X=1TO4000:NEXT:PRINT"H": 
-■GOTO 182 
210 PRINT :PRINT"0K ";A$;", LET' HAVE A - 

-.GO AT SOME" 
211 PRINT : PRIKT"rHULTIPLICATIONr. ": 
-.FOR X=lTO4000:NEXT:PRINT"fi": 
-.GOTO 182 
213 REM CHOOSE NUMBER OF DIGITS TO BE -. 

-.GENERATED FOR EACH PROBLEM 
220 PRINT"fi 
222 PRINT "HOW MANY NUMBERS VJOULD YOU -. 

-.LIKE" 
230 PRINT:PRINT"IN YOUR PROBLEMS, 1,2, 

-.3 OR 4 ?" 
232 GET B5:IF 8$="" THEN GOTO 232 
235 IF B$<"1" OR B$>"4" THEN GOTO 232 
237 B=VAL{B$} :PRINT"fi" 

240 PRINT:PRINT:PRINT"ALRIGHT ";AS;", 
-.I'LL CREATE ";B;"- NUMBER" 

245 PRINT ;PRINT"PROBLEMS FOR YOU. YOU -. 

-.WILL PROBABLY WANT" 

246 PRINT :PRINT"TO DO THE MORE COMPLEX -. 

-.PROBLEMS ON PAPER" 

247 PRINT:PRINT"BEFORE TYPING YOUR -. 

-.ANSWER ON THE SCREEN." 
250 PRINT;PRINT"PRESS ANY KEY WHEN -. 

-.YOU'RE READY." 
254 GET B$:IF B$ ="" THEN 254 

260 PRINT"fi 

261 RETURN: REM GO BACK TO 187 

26 9 REM RANDOM NUMBER PROBLEM GENERATOR 

270 PRINT:C=0 

271 C=C+1:IF O10 GOTO 482 

272 PRINT: PRINT"rPROBLEM # " ; C 

273 LET X=INT( (10"B-1) *RND(1}+1) 

274 IF X< 10"(B-1) THEN 273 

280 LET Y=INT( (10'^B-1)*RND(1)+1) 
285 IF Y< 10'(B-1) THEN 280 
287 0=0 

291 IF G=2 THEN GOTO 600; 

-.N SUB-ROUTINE 

292 IF G=4 THEN GOTO 500; 

-.TION SUB-ROUTINE 

293 GOTO 336: REM ADDITION SUB-ROUTINE 

294 PRINT:PRINT"fi":H=0 

295 H=H+1:IF H>10 THEN GOTO 482; 

-iREM GENERATES PROBLEMS FOR -. 
-.DIVISION ONLY. 

296 PRINT"j:PROBLEH # " ; H 

298 LET F=INT( (10"B-1)*RND(1)+1) 

299 IF F<10"(B-1) THEN GOTO 298 

305 LET Y=INT(10''5*RND(1)+1) 

306 IF F>Y THEN 305 

307 PRINT 

316 O=0:GOTO 318 

317 0=2: REM MARKER FOR 1ST WRONG ANSWER 

318 PRINT: PRINT"USE rDELETEr KEY FOR -. 

-.CORRECTIONS." 
320 PRINT:PRINT:PRINT" x";Y;"/"; 

-.F 



REM SUBTRACT 10 



REM MULTIPLICA 



321 

322 

323 

324 

325 

326 

328 
329 
330 
331 
333 
334 
335 
336 
340 
345 

346 

347 

350 
355 
357 
358 
359 
365 
370 
380 

390 



395 
396 

400 
405 
406 
410 

415 
416 
420 

425 
426 
430 

434 
435 
436 

437 
450 

459 

460 
461 
462 
465 
470 

471 

472 



PRrNT:PRINT:PRINT"TYPE YOUR -. 

-.WHOLE-NUMBER ANSWER, THEN" 
PRINT: PRINT"PRESS 'RETURN', AND i 

-.TYPE THE REMAINDER." 
PRINT:PRINT"IF THERE IS NO REMAINDER 

-., TYPE A 0. 
PRINT:PRINT:INPUT"YOUR rWHOLE-NUMBER 

•^r ANSWER = " ; Z 
PRINT: INPUT"ENTER rREMAINDERr AND -. 

-.PRESS "RETURN' . " ; R: PRINT"fi 
M=INT(Y/F) :U=Y-(M*F) :REM DETERMINE -, 

-iREMAINDER 
IF M=Z AND R=U THEN 1000 
AND ROU THEN 3999 
THEN 2000 



THEN 3000 



!X 



TYPE ANSWER, 



USE THE 



DELETE ANY 



IF M=Z 

IF M>Z 

IF M<Z 

0=2 

IF G=4 THEN 500 

IFG=2 THEN 605 

PRINT:PRINT" 

PRINT" +";Y 

PRINT" 

-. PRESS RETURN 
PRINT: PRINT" 

-.rSPACE-BARf TO" 
PRINT: PRINT" 

-TERRORS" 
M=X+Y 

PRINT"TTTT";SPC(B+5) :GOTO907 
PRINT"H 

IF W=M THEN 1000 
IF W<M THEN 2000 
IF W>M THEN 3000 
E=INT(4*RND{1)+1) 
ON E GOTO 390, 400, 410, 420: REM PICK -. 

^AN "ATTAPERSON" STATEMENT. 
PRINT "GOOD SHOW ";A$;", I'M PROUD -. 

-.OF YOU!":REM PRINT AND INCREMENT ■ 

-.SCORE. 
S=S+1:O=0:IF G<>3 GOTO 271 
GOTO 295 

PRINT"THAT'S IT ";A$;", WAY TO GOII" 
S=S+1:O=0:IF G03 GOTO 271 
GOTO 295 
PRINT"RIGHT YOU ARE ";A$;". KEEP -. 

-.IT UP. " 
S=S+1:O=0:IF G03 GOTO 271 
GOTO 295 
PRINT"YOU GOT IT RIGHT. HOORAY -. 

^";A?;"1 I !" 
S=S+1:O=0:IF G<>3 GOTO 271 
GOTO 295 

print "sorry ";a9;", that's too -i 
-tlow. " 

IF >1 AND 
IF >1 AND 
IF <2 AND 
GOTO 317: REM 



G03 THEN GOTO 470 
G=3 THEN GOTO 650 
G03 THEN GOTO 333 
GIVE PROB. AGAIN. 



PRINT "NICE TRY ";AS;", BUT THAT'S -. 

-.TOO rHIGH. " 
IF 0>1 AND G03 THEN GOTO 470 
IF 0>1 AND G=3 THEN GOTO 650 
IF 0<2 AND G03 THEN GOTO 333 
GOTO 317 

REM GIVE CORRECT ANSWER. 
PRINT :PRINT"THAT'S TWO CHANCES -. 

-";AS;"." 
PRINT :PRINT"THE CORRECT ANSWER IS -. 

-.";M:FORX=1TO50O0:NEXT:PRINT"R 
PRINT" ": 

-.PRINT: PRINT 



February, 1981. Issue 9. 



COMPUTE! 



59 



TYPE ANSWER, 
USE THE -. 

DELETE 



475 0=0 

480 GOTO 271 

482 FOR I=lTO1500:NEXT:PRINT"fi 

483 IF S=10 THEM PRINT"fi" : GOTO 5000 

485 PRINT:PRINT:PRINT"YOU GOT ";S;" -> 

-iRIGHT FOR THIS SET ";A$: PRINT: 
-.PRINT 

486 S=0 

487 PRINT"WOULD YOU LIKE TO TRY ANOTHER -. 

-.SET OF" 
4 89 PRINT: PRINT"PROBLEMS? " ? : PRINT"TYPE -. 
-.Y OR N" 

490 GET E$:IF E$="" THEN GOTO 4 90: 

-.PRINT"fi" 

491 IF E$="Y" THEN GOTO 140 

492 PRINT "fi 

493 PRINT: PRINT: PRINT :PRINT"OK, ";A$;". ^ 

-nWE'LL CALL IT QUITS FOR NOW." 

495 PRINT: PRINT"THANKS FOR USING HE -. 

-.TODAY. SEE YOU rSOON." 

496 PRINT: PRINT: FOR X=1T0 80 : PRINT"lj:lf " 

-.;:NEXT 
4 97 END 

500 PRINT:PRINT:PRINT" 
505 PRINT" X ";Y 
510 PRINT" 

-. PRESS RETURN" 
513 PRINT" 

-.XSPACE-BAR rTO" 
515 PRINT:PRINT" 

-.ANY ERRORS" 
517 M=X*Y 

520 PRINT"TTTT";SPC(B+7) :GOTO907 
600 IF Y>X THEN 280 
605 PRINT:PRINT" " ; X 
610 PRINT" -";y 

620 PRINT" TYPE ANSWER, 

-. PRESS RETURN 

621 PRINT:PRINT" USE THE -. 

-.xSPACE-BARf TO" 

622 PRINT: PRINT" DELETE ANY -. 

-.ERRORS" 

625 M=X-y 

626 PRlNT"TTTT";SPC(B+5) :GOTO 907 

630 PRINT "GOOD TRY ";A$;". YOUR ANSWER - 

n 

— I 

631 PRINT: PRINT"OFx ";2;"f IS RIGHT, 

-. BUT YOUR" 

632 PRINT: PRINT"REMAINDER IS WRONG.": 

-iFOR X=1T0 5500: NEXT :PRINT"fi" 
634 IF 0>1 THEN 650 
636 IF 0<2 THEN 317 

650 PRINT :PRINT"THE CORRECT ANSWER IS -. 

-r";M 

651 PRINT: PRINT"AND THE REMAINDER IS -. 

-.j:";U:F0R X=1T0 6500 : NEXT: PRINT"fi" 

652 GOTO 295 

907 T=0 

908 FOR I=1T0 9:Z$(I)=STR$(0) :NEXT 
910 FOR I=1T0 9 

913 T=T+1 

920 GETZ$(T):IF Z$(T)=""THEN 920 

921 IF Z$(T)=CHRS(32)THEN Z $ ( T) =STR$ ( 0) : 

-.G0T0931 

922 IFZ$(T)=CHR$(13)THEN Z$ (T) =STR$ ( 0) : 

-.G0TO357 

923 PRINTZ$(T) "«" ; 

924 YS=Z${9)+Z$(8)+ZS(7)+Z$(6)+Z$(5)+Z?( 

-t4)+Z$(3)+Z$(2)+Z$(1) :W=VAL(yS) 

925 NEXT 

931 PRINT"»"CHR$(32) "<"; :T=T-1 : 1=1-1 : 



3020 
3281 



-.GOTO920 

999 REM RIGHT ANSWER PHASER SOUND 

1000 POKE 59466, 0:POKE 59467,16: 

-■POKE 59466,15 :FOR N= 1 TO 3 
1010 FOR NN= 30 TO 255 STEP 6:P0KE -. 

-n59464,NN:NEXT:NEXT 
1020 POKE 59467, 0:GOTO 370 

1999 REM LOW ANSWER SOUND 

2000 POKE 59466,0: POKE 59464,255: 

-.POKE 59467, 16:P0KE 59466,1 
2010 FOR N= 1 TO 1200:NEXT 
2020 POKE 59467,0: GOTO 430 

2999 REM HIGH ANSWER SOUND 

3000 POKE 59466,0: POKE 59464,100: 

-. POKE 59467,16: POKE 59466,200 
3010 FOR N= 1 TO 1200:NEXT 
POKE 59467, 0:GOTO 450 
F Z=M AND R=U THEN 1000: IF M=Z AND - 

-.ROU THEN 4000:IF Z>M THEN 3000 

3999 REM RIGHT ANSWER, WRONG REMAINDER -. 

-.SOUND 

4000 C=0 

4005 IF C=5 THEN 630 

4010 POKE 59464,150: POKE 59467,16: 

-. POKE 59466,15 :F0RN=1T075:NEXT: 

-. POKE 59467,0 
4020 FOR X=l TO 500:NEXT X 
4025 C=C+1 
4030 GOTO 4005 

4999 REM SOUND FOR 10 OUT OF 10 RIGHT 

5000 PRINT"[i 

5005 POKE 59466,0: POKE 59467,16: 

-. POKE 59466,51: FOR N= 1 TO 5 
5010 FOR NN= 225 TO 120 STEP-2: POKE -., 

-n59464,NN:NEXT:FOR NN= 120 TO 255 - 

-.STEP 2 
5020 POKE 59464, NN:NEXT:NEXT:POKE 59467, 

.0 . 

5030 GOTO 9 ^ 



NEED DISKETTES? 

Call free (800)235-4137 



BASF 

MEMOREX 
UDysan 




PACIFIC 
EXCHANGES 

100 Foothill Biud 
San Luis Obispo, CA 
93401 (In Cai call 
1805)543-1037) 



60 



COMPUTE! 



February, 1981 Issue 9. 



PET Spelling 
Lessons Your 
Students Can 

Pl'AnflPA ToryEsbensen 
' ■ ^|i#^«l ^ Minneapolis. MN 



This article presents and explains the format for a 
spelling program that requires only the addition 
of some data lines in order to become fully opera- 
tional. The needed data lines arc so easy to create that 
even elementary school students (grades four and up) 
should be able to do the job. 

My own experience as a professional educator 
indicates that drill and practice spelling tapes for 
microcomputers are among those programs most fre- 
quently requested by classroom teachers. In some 
instances, the need is for programs that run "on all 
fours" with a particular set of spelling workbooks. 
In other cases, teachers would like to have programs 
that focus on certain groups of words identified as 
Spelling Demons. Sometimes, there is a desire to shape 
word lists that will meet the needs of individual 
students. 

The program listed in this article is called 
GUESS THAT WORD. It is offered to the readers 
of COMPUTE as one way of developing a flexible 
response to the demand on the part of teachers for 
microcomputer spelling exercises that can be tailor- 
made to fit individual learning objectives. 

Figure 1 is the program listing of GUESS THAT 
WORD. Lines 7000-7999 arc for entering spelling 
words as data. Multiple spelling lists can be entered. 
Each list should be preceded by a number identifying 
the list. An arrow pointing up concludes each list. 
Lines 7000-7010 are the data lines for the first 
spelling list. Note that all data entries are separated 
by commas. 

Typing data line entries is the only thing that 
needs to be done in order to complete the GUESS 
THAT WORD program. Once students are provided 
with the word lists to be entered, typing them as 
data line entries should be a relatively simple task. 
Following this, the data lines should be checked to 
spot any typographical errors, and the entire program 
should be run to identify any operational errors. These 
are the final steps in the process. When this has 
been accomplished, the program is complete. 

Briefly, here is how GUESS THAT WORD 
works when the program is run: 

1. As requested by the computer, the student types 
in the number of the desired word list. 



2. The computer randomly selects a word from this list 
and, near the top of the screen, prints a row of gray 
boxes equivalent in length to the length oi' the chosen 

word. 

3. The student now has three choices. He/she can (a) 
try to guess the entire word, (b) guess a single letter, 
or (c) ask the computer to reveal a letter of the word. 

4. If the student tries to guess the word, 100 points 
are won if the guess is right, and 5 points are 

lost if the guess is wrong, 

5. If the student tries to guess a letter, the cost of 
the guess (regardless of its accuracy) is 1 [joint. If the 
student guesses correctly, all such letters in the word 
are revealed. If the student's guess is wrong, no 
letters are revealed. 

6. If the student asks the computer to show a letter, 
only one letter is revealed even though more than 
one such letter may be in the word. The cost of this 
option is always 2 points. 

7. When the student finally guesses the word, the 
computer summarizes the results on an ongoing basis. 
This includes the average score per word, plus a list 
of the specific words presented by the computer. 

The program listing in Figure 1 shows 5 lists of 
words sometimes identified as Spelling Demons. These 
lists can be changed simply by changing the data 
line entries. 

Readers who wish to copy this program listing are 
invited to do so. Readers who do not want to bother 
with this may purchase the program tape itself for 
$7,95 from MICRO-ED, Inc., P.O. Box 24156, 
Minneapolis, Minnesota 55424, 

The author would be glad to respond to questions 
and comments from interested readers. 

8 POKE59468,12 

9 REM WRITTEN BY T. ESBENSEN FOR 

10 PRINT"Ri^ttt^t»»»»>>iMICRO-EDr , 

-. INC." 

11 PRINT"^»»»»»P.O. BOX 24156" 

12 PRINT"^i'»>»»»»>MINNEAPOLIS, -. 

-.MINNESOTA 55424" 
15 FORZ=1TO2000:NEXTZ 
70 SP$=" 

n 

80 DIM W$(51) ,M% (51) ,WD$(51) ,MM{25) 
90 PRINT"R":TI?="000000" 
95 PRINT"iJ^i" 

101 pj^jiqip"!^^^^^^^^******************** 

102 PRINT"x»>»»»* * 

103 PRINT"x>»>»»>* GUESS THAT WORD! * 

104 PRINT"r»»»»* * 
1 S PR I NT "r^^^^^^^-^******************** 

110 PRINT"t" 

165 PRINT"\hWHICH WORD LIST DO YOU WANT"; 

170 INPUT"»>2'«-*<";LI$ 

175 PRINT"R" 

180 RESTORE 

190 READD$:IFD?="*'"THENPRINT"fi^^NO SUCH -. 

-.LIST. TRY AGAIN.":GOT0165 
192 PRINT "Mit^tt»»»»^>>>»>»^>^JlSEARCHI 

-.NG" 



FebruOFv. 1981 Issue 9. COMPUTE! 



AT-16 16K MEMORY BOARD 

for ATARI 800 

^ ASSEMBLED & TESTED 

^ READY TO PLUG IN 

^ COMPLETELY COMPATABLE 

^ NO MODIFICATIONS 

^ ADDS 16K OF 200NS RAM 

^ ONE YEAR WARRANTY 

ONLY $1 19.50 

V 32K SPECIAL 

Upgrade your system by 32K and SAVE $39.S0 

2 AT-16 16K Memory Boards 

ONLY $199.50 



Ideas and products to extend 
your system inexpensively. 




MICROTEKnc 



9K14 CHESAPEAKE DR., SAN DISOO, CA. 92128 (714)278-0680 TWX 910-936-1260 



62 



COMPUTE! 



Februory, 1981- Issue 9. 



195 IFD$<>LI$THEN190 3110 

300 W=W+1:READW$(W) :IFW$(W)<>"""THEN300 3560 

400 N=INT(RND(TI)*(W-1) )+l 3570 

410 IFM%(N>=-1THEN400 3600 

420 M%(N)=-1 7000 

430 PRlNT"at^^»»»»»»»",. 

440 F0RZ=1T0LEN(W$(N) ) 

450 PRINT "&"; 7010 

460 NEXTZ 

500 PRIKT'-M^tt^t-^-PRESS THE NUMBER OF -. 

-.YOUR CHOICE:" 7020 

510 PRINT"i^xlf>READY TO GUESS THE WORD" 
520 PRINT "i^x2r>READY TO GUESS A LETTER" 
530 PRINT "li'iSf^COMPUTER SHOULD SHOW A -. 7030 

-.LETTER" 
550 GETG$:IFG$<>"1"ANDG$<>"2"ANDG$<>"3"T 7040 

^HEN550 
560 PRINT "Mit'T^ii'f" 

570 F0RZ=1T08:PRINTSP$:NEXTZ 7050 

575 GETZ$:IPZ$<>""THEN575 

580 G=VAL(GS) :ONGGOTO1000, 2000, 3000, 4000 7060 
1000 PRINT "htif'^t'H't'WHAT IS THE WORD?" 
1010 PRINT"'|WIN I.100r POINTS IF YOU GET -> 

-.IT." 7070 

1020 PRINT"^LOSE j:5r POINTS IF YOU MISS -. 

-.IT." 70g0 

1030 PRINT"+" 
1050 INPUT "»»2-«'«<";R$ 

1055 IFR$="2"THEN1000 7090 

1060 IFR$=W${N)THENPRINT"^XRIGHT": 

-.PT=PT+100:FORZ = 1TO1000:NEXTZ: 8000 

-.GOTO9000 9000 

1070 IFR$<>W$(N)THENPRINT"i^xWRONG" 9002 

1080 PT=PT-5:FORZ=1TO1000:NEXTZ 9005 

1560 PRINT "MtTj't^t'" 9010 

1570 PORZ=1TO10:PRINTSP$: NEXTZ 

1600 GOTO500 9015 

2000 PRINT"M\|'\^^Tt'^t'WHAT LETTER DO YOU -. 9020 

-.GUESS?" 
2010 PRINT"\hTHE COST IS xlf POINT PER -. 9050 

-.GUESS." 9060 

2030 PRINT"^^" 9070 

2050 INPUT "»>l<<-«",-R$ 90 80 

2052 IFR$="1"THEN2000 9090 

2055 IFLEN(R$) >lTHENPRINT"Mit'4'tt": 9100 

-.FORZ = 1TO10:PRINTSP$:NEXTZ :GOTO2000 9110 
2057 PRINT"li+i^»»>»»»>»"; 9115 

2060 F0RZ=1T0LEN(W${N} ) 9117 

2070 IFR?=HID$(W$(N) ,Z,1)THENPRINTR$; : 9118 

^HM{Z)=~1 9120 

2080 IFR$<>MID$(W$(N) , Z , 1) THENPRINT">" ; 
2090 NEXTZ 9130 

2095 PT=PT-1 9140 

2560 PRINT "tn^i^ti^ii'" 9999 

2570 FORZ=1TO10:PRINTSP$:NEXTZ 
2600 GOTO500 
3000 PRINT "iit^^it-T^^THE COMPUTER WILL -. 

-.SHOW A LETTER." 
3010 PRINT"t^IT WILL COST YOU x2r -. 

-.POINTS." 
3020 FORZ=1TO1000: NEXTZ 
3030 NN=INT(RND(TI) *LEN(W$(N) ) ) +1 
3040 IFMM{NN)=-1THEN3030 
3050 MM(NN)=-1 
3060 PRINT"M^4'»»»»»>"; 
3070 F0RZ=1T0NN 
3080 PRINT"»"; 
3090 NEXTZ 
3100 PRINTMID$(W$(N) ,NN,1) 



PT=PT-2 

PRINT"iiTJ'itV't" 

FOR2=1TO10:PRINTSP$: NEXTZ 

GOTO5 00 

DATA 1, WHETHER, WRITING, THROUGH, 

-.ACHE, DOCTOR, KNOW, LA ID, EARLY, 

-.MAKING, BELIEVE 
DATA OFTEN, FRIEND, PIECE, GUESS, 

-.RAISE,CHOOSE, HOARSE, SEPARATE, 

-.INSTEAD, JUST," 
DATA 2 , WOMEN , WEDNESDAY , TONIGHT , 

-.VERY, STRAIGHT,AGAIN, DOES, LOOSE, 

-.EASY, BEEN 
DATA FEBRUARY, NONE, ONCE, GRAMMAR, 

-.HALF, READ, COLOR, SAID, HOUR, KNEW," 
DATA 3, ALWAYS, DONE, LOSE, AMONG, 

-.ANSWER , MANY , MEANT, MINUTE , ENOUGH , 

-.EVERY, FORTY 
DATA BEG INNING , CHANCE , HAVING , SAYS , 

-.SOME, TOO, WHICH, THEIR, WEAR," 
DATA 4, ANY, EXISTENCE, MUCH, BLUE, 

-.BREAK, BUILT, BUSINESS, BUSY, BUY, 

-.READY, HEAR 
DATA HERE , COMING , SEEMS , COUGH , COULD , 

-.SHOES, COUNTRY, SIMILAR, DEAR," 
DATA 5 , S INCE , SUGAR , TROUBLE , WHOL E , 

-.SURE, TRULY, TEAR, TUESDAY, WHILE, TWO, 

-nWOULD 
DATA DUMB , THERE , WRITE , THEY , THOUGH , 

-.WROTE, TIRED, WEEK, WHERE," 
DATA "" 
PRINT"fi" 

F0RZ=1T0LEN(W$(N) ) :MM{ Z ) =0 : NEXTZ 
P=P+1 
PRINT"^t'XLIST:f»";LI$; ">»»»»>xWORD 

n PROBLEM :f";P 
SC=INT( (PT/P)+.5) 
PRINT"4rAVERAGE SCORE PER WORD: 

-.f " ; SC 
PRINT "i-WORDS PRESENTED BY COMPUTER" 
PRINT" ### ###»############### ##### " 
WD${P)=W$(N) 
F0RZ=1T0P 

PRINT"x";WD$(Z) ;">"; 
C=C+1 : IFC=3THENC=0 :PRINT 
NEXTZ 
PRINT 
C=0 

IFP=W-1THENEND 
PRIMT"^^PRESS Si<l1 TO STOP OR -. 

-.Ct-^IT TO CONTINUE." 
GETG$:IFG$<>"S"ANDG$<>"C"THEN9130 
IPGS="C"THEN400 
END © 



February, 1981. Issue 9 



COMPUTE! 



63 



Atari® 
800™ 1 6K 
Personal 
Computer 

List $1080 

only $779 




Atari® Peripherals: 

400 aK $ 389 

410 Recorder 59 

815 Disk 1139 

810 Disk 519 

822 Printer 349 

825 Printer 749 

830 Modem 1 49 

850 Interface Module 169 

Atari® Accessories 

CX852 8K RAM S 89 

CX853 RAM 1 44 

CX70 Light Pen 59 

CX30 Paddte 17 

CX40 Joystick 17 

CX81 00 Blank Diskettes (5/box| 21 



Atari® Software ATARf 

Entertainment: 

CXL4004 Basketball S29 

CX41 05 Blackjack 12 

CXL4009 Chess 29 

CXL401 1 Star Raiders" 44 

CX4111 Space Invaders 17 

CXL4006 Super Breakout' 29 

CXL401 3-D TiC-Tac-Toe 29 

CXL4005 Video Easel- 29 

Personal Interest & Developement 

CXL4104 Mailing List $16 

CX41 07 Biorhyttim 12 

CXL4007 Music Composer 44 

CX41 10 Typing 19 

CX4101 An Invitation to 

Programming 16 

Information & Communication: 

CXL401 5 TeleLink" 19 

Programming Languages: 

CXL4003 Assembler Editor 45 

CXL4002BASICComputing Language . 45 



To Order: 

Phone Orders invited. Or send cashiers check or money order. Equipment shipped UPS 
collect. Pennsylvania residents add 6% sales !ax. Equipment is subject to price change 
and availability without notice. 



Call For Prices On: 

Commodore Computers 
Professional Software 
Personal Software 



Education: (Talk & Teach Courseware) 

CXL4001 Education System 

Waster S20 

CX6001 U.S. History 22 

CX6O02 U.S. Oovernment 22 

CX6003 Supervisory Skills 22 

CX6004 Wortd History (Western) 22 

CX6005 Basic Sociology 22 

CX6006 Counseling Proceedures — 22 

CX6007 Principles of Accounting 22 

CX6008 Physics 22 

CX6009 Great Classics 22 

CX6010 Business 

Communications 22 

0X6011 Basic Psychology 22 

CX601 2 Effective Writing 22 

CX6014 Principles ot Economics 22 

CX601 5 Spelling 22 

CX601 6 Basic Electricity 22 

CX601 7 Basic Algebra 22 

Professional Applications: 

CX8102 Calculator S22 

CX4109 Graph It 16 

CX4 1 03 Statistics 16 

Investment Analysis: 

CX8106 Bond Analysts S 19 

CX8107 Stock Analysis 19 

CX81 01 Stock Charting 19 



Computer Mail Order 
501 E. Third St. 
Williamsport, PA 17701 
(717) 323-7921 



McTerm 




ivDISON*^ 
OMPUTER 



V A Telecommunication Package 



With the McTerm pacl<age your Commodore computer can now become a very intelligent 
terminal. It allows you to easily participate in the electronic mail revolution. McTerm can 
communicate simultaneously with another PET or mainframe. You can transfer entire disk files 
to other disk drives; send or receive program, WordPro, sequential, or relative files. This 
package works on Commodore computers with 3.0 or 4.0 Basic, 1 .0 or 2.0 DOS, 40 or 80 column 
computers, and 2040 or 8050 disk drives (requires the use of TTL Level RS-232 modems). 

a 

Complete with Program, ROM, Cable and Manual. 
Price: $195.00 

Features include: 

•■■j 

-Baud selection from 75 to 1200. 
-Full and half duplex, also local echo. 
-Supports odd, even and mark parity. 
-CRC, error checking for PET to PET files. 



1825 MONROE STREET, MADISON, Wl 53711 (608)255-5552 
-Dealer Inquiries Are Welcome- 



64 



COMPUTE! 



f ebruarv. 1V81 Issue 9. 




List Apple 
Integer Basic 
Programs One 
Page At A Time 

Keith Falkner, 
Toronto, Canada 

The obvious way to examine an unfamiliar program 
is to type "LIST". In APPLE's INTEGER BASIC, 
this often gives little or no useful information, 
because the whole program is listed at great speed, 
and the moving display can scarcely be read. If the 
listing could be stopped, this would be no problem; 
however, only the RESET key stops the listing. 
Pressing the RESET key is brutal and inelegant, and 
can cause loss of the program being listed. 

This small program in Assembly Language pro- 
vides a convenient way to list INTEGER BASIC 
programs without those two problems. It lists one 
screen-full of the BASIC program, then waits for any 
key to be pressed. If any key but CTRL-C is 
pressed, the next screen-full of the program is listed, 
and so on until the whole BASIC program has been 
displayed. At any time, CTRL-C can be entered, 
and the listing ceases, with one screen-full of the 
BASIC program still visible. This makes it simple to 
browse an INTEGER BASIC program either quickly 
or slowly, and stop after any screen-load ("page"). 

This program does not interfere with BASIC, 
and as listed here, it occupies a part of memory 
where it will not likely be damaged. Locations 
700-762 (S2BC-$2FA) are approximately the final 
quarter of the 256-byte keyboard input buffer, and 
are used only if more than 188 characters are entered 
as a line of BASIC or in reponsc to an INPUT in- 
struction. Either of these is very unusual, and in 
practice, the program is not over-written. 

Users with little experience in machine language 
can easily enter this program with the Mini- 
Assembler which is part of APPLE's Monitor, as 
follows: 

> CALL - 15 1 (enter the Machine-language monitor) 
'F666G (enter the Mini-Assembler) 

!2BC:LDACA (no need to type spaces or $) 



! STAE2 (a space is needed after the !) 

! LDACB (and so on ...) 

For the "branch" instructions, BCC, BNE, BCS, and 
BPL, the actual address branched-to is needed. For 
example: 

! CMP4D (the instruction on line 0027) 

! BNE2E0 (it branches to SHOWME at $2E0) 
APPLE suggests using the RESET key to exit the 
Mini-Assembler, but there is a gentler way: 
ISFF69G (type it as shown, with no spaces) 

The program can be saved on disk via: 
•BSAVE LISTAPAGE,A700,L63 
It can be saved onto tape via: 
•2BC.2FAW (there will be only 1 "beep") 
At any time, this program can be loaded into memory 
without disturbing any BASIC program already 
present. To load it from disk, type: 
>BLOAD LISTAPAGE 

To load it from tape, a more complicated sequence 
is needed: 

^CALL -151 (to Monitor again) 

•2BC.2FAR (press PLAY before pressing RETURN) 

•E003G (or CTRL-C) 

In either case, the program is safely hiding in loca- 
tions 700-762 inclusive, and it can be u.seci in these 
ways: 

To list a BASIC program from the beginning, just 
type "CALL 700" to see the first page. Press any 
key except CTRL-C to see more, or press CTRL-C 
to stop listing after any page. 

The program has a second entry-point which is 
also useful. Type "CALL 708" to resume listing a 
program after the line most recently listed. For ex- 
ample, to list some lines starting with line 2000, type 
"LIST 1999", whether or not such a line exists, 
then type "CALL 708", and successive pages star- 
ting with line 2000 will be listed. "CALL 708" can 
also be used to resume a listing which had been 
begun by "CALL 700" and stopped by CTRL-C. 

Experienced users of machine-language will have 
noticed that this program is relocatable. In other 
words, it does not contain any reference to its own 
absolute address. That in turn means that it can 
occupy any locations in memory that are not in use 
for other purposes, and function there without 
needing any changes. Other locations which can be 
used to contain this program include, from most con- 
venient to least: 

Page 3, locations 768-830 (or nearby) is easiest 
because neither the APPLE monitor nor B,A.SIC 
makes use of this space, hence of course, ii is the 
popular place for noise-making routines and various 



February, 1981 Issue 9, 



COMPUTE! 



65 



innerfgce 

BUflNlsFS^TEMS 

Capital Asset Managment System 



POR: _ 

apple 




GAMS: 



SIMPLE, 

CONCISE, 

FUNCTIONAL, 

ACCURATE, 

EFFICIENT, 

USABLE 

SOFTWARE from I.B.S. 

Having developed accurate and 
understandable software for both 
government and business, I.B.S. has 
at last Gone Public, with C A.M.S. — 

CAPITAL ASSETS MANAGEMENT SYSTEM, 
a simple, easy-to-use system designed 
for the APPLE Computer* and you. 

DEPRECIATES assets according to one 

of the eight approved schedules 

INVESTMENT CREDIT and RECAPTURE 

are computed automatically 

PROJECTIONS aid in the selection of 

method and term for new assets 

PERSONALIZED REPORTS in either 80 

or 132 column formats 

AUTOMATIC SUBTOTALING selected by 

the user 

SAFTEY ROUTINES check input for most 

errors 

AUTOMATIC DISK FILING with user 

control 

CAMS records 23 pieces of information on each asset: GL accounts; memos; dates; costs; 

method &> life; full description; user ID/dept.; other deductions. 

CAMS reports on depreciation: Straight-line; 125%, 150%, 200% w/wo automatic switch to 

Straight-line, Sum-of-year-digits AND Investment Tax Credit & Recapture amounts for each year. 

CAMS requires a 48K Apple with disk and (at least) 80-column printer. 

Cams is fully supported by professional documentation and by I.B.S. 



With just a few clear and simple 

keystrokes, you can view any of two 

hundred assets depreciated FROM any 

time TO any time, using any of the eight 

schedules. 

By SEEING the results, you can make 
accurate decisions NOW, when it counts. 

CAMS will automatically search your 

records for assets which qualify for either 

Investment Credit or Investment Credit Tax 

Recapture. 

CAMS prompts you with clear and simple 

messages on the screen for all entries. 

Special safety routines check all practical 

inputs for errors. Because CAMS 

maintains all files automatically, it serves 

not only as a tool for projections, but as a 

RECORD FILING system as well. 

And since no one should be limited by 

software, INNERFACE has made CAMS for 

user back-up copies as well. Because of 

this, you can record an UNLIMITED 

number of assets on individual disks for 

privacy and safe-keeping. 



®. 



* APPLE is a trademark of Apple Computer Inc. 



innerFace 

BUSINESS SV5TEM5 



S2.00 SHIPPING 

CA RES ADD 5.97 TAX 



CAMS is 99.80 

box 834, pacific groveCA 



tT:.-^! 



66 



COMPUTE! 



February, 1981- Issue 9. 



Other uses which would conflict with this. 
2048-2110. In issue CLR and LOMEM:2110 to 
prevent BASIC variables from over-writing the 
routine. 

16322-16384. Issue NEW and HIMEM: 16322 to 
prevent a BASIC program from over-writing the 
routine. Those addresses interfere with High- 
Resolution graphics, and will be different in a 
machine with more or less than 16K of memory. 



Other locations, such as the gap above the 
variables and below the program might be tried if 
none of the above appeals. Experiment at will in this 
fashion, and remember, "You can't hurt the com- 
puter by pressing keys". 

This program provides a helpful alternative to 
the "LIST" command, filling an irritating gap in 
APPLE'S flexible and rapid INTEGER BASIC. 



LINE* LOC CODE 



LINE 



0003 
0004 

0005 

0006 

0007 

0003 
0009 
00 1 
0011 
0012 

0013 

0014 

0015 

0016 
00 1 7 
08 1 8 
00 1 9 

0020 

0021 
0022 
0023 
0024 
0025 
0026 
0027 
0023 
0029 

0030 
0031 

0032 
0033 
0034 
0035 
0036 
0037 
003S 
0039 
0040 

0041 

0042 
0043 
0044 
0045 
0046 
O047 
004S 
0049 



0000 
0000 
0000 
0000 
0000 
02BC 

02BC 
02BC 
028 C 
02BE 
02C0 
02C2 
.02i::4 
02C4 
02i::4 
02C4 
02C6 
02r:S 
02Cfl 
02C:C 
02C;F 
02[:'2 
02D2 
02D2 
02C:'4 
02D6 
02D3 
02DR 
02[:'C 
02DE 
02E0 
02E3 
02E3 
02E3 
02E5 
02E6 
02ES 
02Efl 
02EC 
02EC 
02EC: 
02EF 
02F1 
02F3 
02F5 
02FS 
02FB 



.OPT HOSVM 
LIST INTEGER BASIC PROGRRM 
ONE SCREEH-FULL AT fi TINE: 

:*=700 

:<^*ENTER HERE TO LIST FROM START 



A5CH 
S5E2 
fi5CB 
35E3 



m54u 

S5E6 

R54D 

35E7 

2C10C0 

2059FC 



ft5E3 
C54D 
900 S 
DO IB 
FI5E2 
C54C 
B015 
206DE0 



R525 

13 

6904 

C523 
90 E 6 



flDGSUU 
1 0FE 
C9E!3 
D0D7 
2C: 1 SCO 
4C.03E0 



LDfl $CR 
STR $E2 
LOR *CB 
STR *E3 



J IN IT POINTERS TO 
J START OF PROGRRM 



+:+^EHTER HERE TO RESUME LISTING 



LDR $40 
STfl *E6 
LDh $40 
STfl $£7 
RESUME BIT itCOlO 
JSR ^FC5S 



;LIST UNTIL 
;HINEM: HIT 

; RESET KEVBORRD 
;CLERR THE SCREEN 



; SEE IF THERE IS MORE TO LIST. 

RNVMOR LDR ■Jt.E3 

CMP tAD 

BC:C SHCiMME 

BNE EXIT 

LDR *E2 

CMP *4C 

BC5 E)::iT 

SHO(..IME JSR *E06D 



;flLL DONE? 
;N0. 
jVES. 

;MRVBE . . . 
J FOR SURE? 

J^ 1 [__■ ■ 

;LIST ONE LI HE 



SEE IF ROOM TO LIST RNOTHER LINE. 



LDfl *25 
CLC 

ADC #4 

CMP *23 

BCC: RH'v'MOR 



J CURRENT LINE OH SCREEN 

;LEflUE ROOM FOR 4 LINES 
;ROOM FOR RNOTHER LINE? 
;V: GO TR',' TO LIST MORE 



SCREEN IS FULL. WRIT FOR R KE'i 



URITKV LDR *C000 
BPL UfllTK'v' 
CMP #-:rS3 
BNE RESUME 

EXIT BIT *C010 
..IMP *E003 
. END 



;SEE WHICH KEV PRESSED. 
;NONE. KEEP ON UIRITING. 
;WflS IT CTRL-C? 
.JN: DO ANOTHER PAGE. 

PRESET KEVBORRD. 
;BRCK: TO BRSIC. 



Februarv, 1981. Issue 9. 



COMPUTi! 



67 



Software for the Apple II and Apple II Pius 



« 




ASTEROIDS IN SPACE" 

By Bruce Wallace 

An exciting space action game! Your space ship is 
traveling in Ihe middle of a shower of asteroids Blast 
the astefoids with lasers, but beware — big asteroids 
(raEment into small asteroids! The Apple game paddles 
allow you to rotate your space ship, fire its laser gun, 
and give it thrust to propel it through endless space. 
From time to time you will encounter an alien space 
ship whose mission is to destroy you, so you'd better 
destroy it hrsi! High resolution graphics and sound 
effects add to the arcade like excitement that this 
program generates. Runs on any Apple II with at least 
32K of RAIVt and one disk driue. 

On Diskette - S19,9S 





Cassette 



FASTGAMMON" By Bob Christiansen, 
Sound, hi res, color, and musical cartoons have 
tielped make this the most popular backgammon 
playing game for the Apple II. But don't let these 
entertaining features fool you — FASTGAMMON 
plays serious backgammon. Runs on any Apple II 
with at least 24K of RAM. 
$19.95 Diskette - S24,95 



ASTROAPPLE'" by Bob li^ale. 
Your Apple computer becomes your astrologer, 
generating horoscopes and forecasts based on the 
computed posilons of the heavenly bodies. This 
program offers 3 delightful and stimulating way to 
entertain friends, ASTROAPPLE produces natal 
horoscopes (birth charts) for each person based 
on his or her birth data. Any two people may be 
compared for physical, emotional, and intellectual 
compatibility. The program is written in Applesoft 
BASIC with machine langusEe subroutines. It 
requires either RAM or SOM Applesoft and at least 
32K of memory. 

Cassttte - tU.95 Diskette - SI9.95 





FRACAS'" by StuafI Smith. 

A fantastic adventure game like no other! Up to eight 
players can participate in FRACAS at the same time. 
Journey in the land of FAROPH, searching for hidden 
treasure while warding off all sorts of unfriendly anrt 
(iangerous creatures. You and your friends can compete 
with each other or you can lOin forces and gang up on the 
monsters. Your location is presented graphically and sound 
effects enliuen the battles. Save your adventure on diskette 
or cassette and continue it at some other time. Both integer 
BASIC and Applesoft versions included. Requires at least 
32K of RAM. 



Cassette - SI9.95 Diskette ■ S24.95 



BENEATH APPLE MANOR™ by Dor Worth. 
Descend beneath Apple Manor into an under- 
ground maze of corridors, rooms, and secret 
passages in quest of rich and powerful treasures. 
The dungeon complex consists of many floors, 
each lower level more dangerous than the last. If 
you can reach the lowest level, you may even find 
the ultimate obiect of your Quest, the fabled 
gofden apple of Apple Manof Strategy isentreme- 
ly important as you deal with a variety of monsters, 
each with its own characteristics. Written in 
integer BASIC with machine language sub- 
routines. Requires integer BASIC and at least 16K 
of RAH on cassette or 32K of RAM on diskette. 

Cassttte - %U,% Diskette 




J19.95 



BATTLESHIP COMMANDER" by Erik Kilk and Matthew Jew. 



A game of strategy. You and the computer each start out by positioning five ships of 
diffefeni sizes on a ten by ten grid. Then Ihe shootmgstarts. Place your volleys skillfully 
— a combination of logic and luck are required to beat the computer. Cartoons show 
the ships sinking and announce the winner, Sound effects and flashing lights also add 
to the enjoyment of Ihe game. Both Applesoft and integer BASIC versions are included. 
Requires at least 32K of RAM, 

Cassette- JU,95 Disltette - J19.95 



BABBLE" by Don Worth, 
Have fun with this unique software. You write a 
story, entering it as a BABBLE program. As you 
write the story you specify certain words to be 
selected by the computer or entered from the key- 
board at execution time. Run the program and 
watch BABBLE convert your story into an often 
hilarious collection of incongruities. The ways in 
which BABBLE can entertain you are limited only 
to your imagination You can compose an 
impressive political speech or write poetry. You 
can plan a dinner menu. You can even form 
images on the screen or compose musical tunes 
with the help of BABBLE. The cassette version 
requires at least 16K of RAM and the diskette 
version requires at least 32K of RAM. BABBLE is 
written in machine language and runs on any 
Apple II computer 

Cassette ■ $19.95 Diskette - S24.95 




BABBLE 



LINKER by Don Worth. 

Turn your Apple II or Apple II Plus into a powerful and productive 
software development machine with this superb linking loader/editor 
package. LINKER does the following and much more: 

• Dynamically toads and relocates suitably prepared machine 
language programs anywhere in RAM. 

• Combines a main program with subroubnes. You can assemble a 
subroutine once and then use it with as many main programs as you 
wish. 

• Produces a map of all loaded routines, giving their location and the 
total length of the resulting module. 

• Contains a library of subroutines incluriing binary multiplication and 
division, print text strings, delay, tone generator, and random 
number generator. 

Linker works with virtually any assembler for the Apple II. Requires 32K 
of RAM and one disk drive. 

Diskette • $49.95 
Manual Only - $19.95 



ss 



QUTiLrry soFTWTiRe 

6660 Reseda Blvd.. Suite 105. Reseda. CA 91335 
(213)344^^99 

Now exclusive distributors for products from The Software Factory, Newhall. California 
*Apple II and Apple 11 Plus are Irademaiks of Apple Computer. Inc 



WHERE TO GET IT; Call us at |2I3| 344-6599 for the name of the Quality Software 
dealer nearest you. If necessary you may order directly from us. Mastercard and 
Visa cardholders may place orders by telephone. Or mail your check or bankcard 
number to Quality Software, 6660 Reseda Blvd., Suite 105, Reseda, CA 91335. 
California residents add 6% sales tax. SHIPPING CHARGES: Within North America 
orders must include J1.50 for first cfass shipping and handling. Outside North 
America the charge for airmail shipping and handling is $5.00. Pay in U.S. 
currency. 



63 



COMPUTE! 



Febfuory. !981. Issue 9 



The 25^ 
Apple II 
Real Time 
Clock 



Eronn Gat 

Oak Ridge, Tennessee 

It is interesting to count the number of features of 
the Apple II which traditionally require boards full of 
parts to implement, but are done with only one or 
two inexpensive chips. For instance, the analog to 
digital conversion for the game paddles would 
normally cost at least $25, but is done on the Apple 
with a single inexpensive timer chip. The refresh for 
the dynamic memory requires no extra parts at all as 
this is done by the video circuitry. 

This philosophy of doing things the easy way 
makes one wonder at the prices that are being 
charged for some of the peripheral boards for the 
Apple, particularly real time clocks. A search for an 
easier {and hopefully cheaper) way yielded a clock 
with good accuracy and any feature found on the 
more expensive boards, including many extra fringe 
benefits, with a total cost of between 3 to 25 cents 
depending on how sophisticated you want it to be. 

All About Interrupts 

Interrupts are something almost every computer hob- 
byist has heard of, but most of the information about 
them is rather cryptic. This section will attempt (note 
that verb) to clarify how interrupts work because 
they form the basis of the 25 cent clock. 

Here is how an interrupt works: on the 6502 
microprocessor there are two pins called IRQ and 
NMI. IRQ stands for Interrupt ReQuest and NMI 
stands for Non Maskable Interrupt. When either one 
of these pins is grounded, the processor finishes the 
machine language instruction it is currently working 
on, saves the program counter and processor status 
register onto the stack, (if you don't know what that 
means it isn't important) and jumps to a program 
somewhere in memory called an interrupt handling 
routine or interrupt handler. It then executes the in- 
terrupt handler until it encounters a RTI (ReTurn 
from Interrupt) instruction. It then restores the status 
register and program counter to their original values 
and continues executing the main program at the 
point where the interrupt occurred. 

The main program is not affected by an inter- 
rupt except that some time is lost during the inter- 
rupt and the main program slows down. How much 



it slows depends on the length of the interrupt 
handler. 

Now suppose that the interrupt handler was a 
routine that incremented a memory location and 
returned. This would then be an interrupt counter; 
i.e. every time an interrupt occurs, the counter is in- 
cremented. Now suppose that a pulse was applied to 
the interrupt line exactly once each second. Voila! A 
real time clock that tells time in seconds. This is the 
idea behind the 25 cent clock. 

More About Interrupts 

Up until now the 25 cent clock has been discussed in 
generalities and theories. This section discusses the 
actual implementation. 

First some more facts about interrupts on the 
6502: There are two main differences between the 
IRQ and NMI interrupts. In the 6502 status register 
there is a flag called interrupt enable. This flag can 
in effect turn off the IRQ line. If the enable flag is 
not set, the 6502 will deny Interrupt ReQuests. It 
will ignore them as if they were not there. On the 
other hand, NMI cannot be turned off. When a Non 
Maskable Interrupt occurs, the processor will always 
act on it and jump to the interrupt handler. 

The second difference is that NMI and IRQ 
have their interrupt handlers at different places in 
memory. IRQ has another difference in that its inter- 
rupt handler is the same routine which handles the 
BRK instruction. BRK in effect generates a IRQ 
signal. There is a way to tell IRQ's from BRK's (in 
fact the Apple monitor does this for you) but this 
takes up quite a bit of time as well as creating other 
complications. NMI therefore is more suitable than 
IRQ for the clock. However, there is no law that 
says IRQ can't be used. 

Next, a signal of known frequency must be 
found. A time base generator can be used, but at 
several dollars a piece it would be difficult to stay 
within the 25(1 budget. An ideal signal can be found 
in the video circuitry. This signal is the 60 Hz 
(meaning 60 times each second) pulse which 
generates the vertical retrace. This signal can be tap- 
ped at two locations shown in figure 1. The physical 
details are discussed in the next section. 

FIGURE I 




t 
C-14-1 



IC 



74LS32 



RIGHT SIDE OF 
MAIN BOARD 

SOLDER POINT 



PIN 4 



Februarv. 1981, issue 9. 



COMPUTE! 



69 




16KRam 
Expansion 

Board for the 

Apple II* 

$195.00 

• expands your 48K Apple to 
64K of programmable 
memory 

• works with Microsoft Z-80 
card, Visicalc, LISA ver 2.0 
and other software 

• eliminates the need for an 
Applesoft* or Integer Basic 
ROM Card 

• switch selection of RAM or 
mother board ROM 
language 

• includes installation and use 
manual 

• fully assembled and tested 



Visa and MasterCard accepted 

Shippins and handling will be added unless 

the order is accompanied by a check or 

money order 
N.C. residents add 4% sales tax 

*Apple II and Applesoft are trademarks of Apple 
Computer, Inc. 




n 



INCORPORATED 

P.O. Box 19144 
Greensboro, NC 27410 
(919) 852-1482 

**Formerly Andromeda Computer Systems 



70 



COMPUTE! 



February. 1931 Issue 9 



The Three Cent Clock 

Implementing the clock in its simplest form involves 
simply connecting the NMI line to a signal source. 
On the Apple, the NMI line can be accessed from 
any of the peripheral slots on the rear of the board. 
The location of the NMI line is shown in figure 2. 
The connection can be made using a prototype board 
or by simply inserting a wire between the metal con- 
tact and the plastic housing of the connector. 

FIGURE 2 



NMI, 



o 


C 3 

•C 3 
t 3 



BACK OF 
MAIN BOARD 

ANY PERIPHERAL 
CONNECTOR 



The 60 Hz signal can be accessed in the two 
locations shown in figure 1. The first place is a small 
solder filled hole in the board. A wire may be 
soldered in the hole, or a wire wrap pin may be at- 
tached and connected to the NMI line via an 
alligator clip to make the clock removable. NOTE; 
This may void your warranty. Check with your 
dealer! 

The other connection point does not involve 
soldering. To make the connection, carefully remove 
the IC at location C-14. The row and column 
numbers are marked on the board itself. Then insert 
a piece of very thin (wire wrap) wire into pin 4 of the 
socket. (See figure 1.) Now carefully reinsert the IC 
making sure it is oriented correctly and all the pins 
are securely seated in the socket. 

Before this connection is made an interrupt 
driver must be entered into memory. If this is not 
done, the system will crash and RESET will have no 
effect until the connection is broken. 

To get the three cent clock off to a flying start, 
enter the short program in listing 1 . This can be 
done in the monitor or the mini-assembler. When the 
program is in memory, connect the interrupt line 
and watch the upper left hand corner of the screen. 
If everything was done correctly, the first character 
on the screen should start changing rapidly. What is 
happening is that sixty times a second the video cir- 
cuitry generates a signal which is now being used to 
generate an interrupt. When an interrupt occurs, the 
processor starts executing the interrupt handler which 
is located at 3FB hexadecimal on an Apple. Usually 
the interrupt handler starts with a jump instruction 
since there are only five bytes of usable memory at 



LISTING 1 

*3FBL 
03FB- 

03FE- 
03F|r_ 



EE 
40 
00 



00 04 



INC 
RTI 
BRK 



$0400 



3FB, but since this program is so short it can be 
entered directly at 3FB. The interrupt handler that is 
now in memory simply increments a memory loca- 
tion and returns to the main program. This is a real 
time clock. It tells time in sixtieths of a second. 
Granted, it isn't very useful as it is now, but that 
will be fixed in a moment. 

Now incrementing a memory location on the 
screen isn't very exciting, but try hitting a few keys. 
Surprise! They still work. In fact, everything works. 
Try dumping out some memory or printing 
something in basic. Everything will work normally 
and the first character on the screen will go right on 
counting. WARNING: the disk will NOT work. 
Neither will the tape. This is because the interrupts 
slow down the main program enough to upset the 
precise timing required by the disk and tape 
routines. Having the interrupt connected will also 
make the bell tone sound peculiar. 

To make the clock more useful, enter the three 
programs in listing 2. The first program is simply a 
jump instruction to the second program which is a 
clock routine to drive an hour-minute-second clock. 
The third program is a basic routine which sets the 
clock and outputs the time of day. The programs are 
thoroughly documented so they won't be discussed 
here. 



LISTING 2 




PROGRAM #1 


*:n-E;L 




03FB- 


4C 


03FE- 


00 


03FF- 


00 



00 03 



JMF' 
BRK 
BRK 



^0300 



Making It Better or 

When 1$ An NMt Really An IRQ? 

It should be clear by now that the power of the clock 
lies in the interrupt driver program, but there are 
some hardware enhancements that can be made. 
These extra features will roll the price up to a respec- 
table 25 cents (more or less). 

The first add-on is a sophicitcated piece of hard- 
ware called a switch. This is used to make easier the 
task of turning the interrupts on and off. The switch 
is installed so that it breaks the connection from the 
60 Hz signal. Personal experience has shown that 
flipping a switch makes a more dignified display than 
pulling a wire in and out. 

The second modification is a bit more com- 
plicated. (Seriously.) This modification allows the 
computer to control the interrupts via one of the an- 
nunciator outputs on the game I/O connector. The 



f ebruory. 1981 Issue V 



COMPUTt! 



LISTING 2 
PROGRAM 

*300LL 

0300" 

0302- 

0304- 

0306- 

0308- 

030A- 

030C~ 

030E- 

0310- 

0312- 

0314- 

0316- 

03 IS- 

031A- 

031C~ 

031E- 

0320- 

0322- 

0324- 

0326- 

0328- 

0329- 

032B-- 

032D- 

032r- 

0330- 

0332- 

0334- 

0335- 

0336- 

0337- 

0338- 

0339- 



#2 

05 05 
86 06 
rt9 3C 

r\2 00 

E6 04 
C5 04 
DO 22 
86 04 
E6 03 
C5 03 
DO lA 
86 03 
E6 02 
C5 02 

no 12 
86 02 

A 9 on 

E6 01 
C5 01 
DO 08 
EG 

86 01 
A5 05 
A6 06 
40 

A5 05 
A6 06 
40 
00 
00 
00 
00 
00 



CLOCK 
STA 
5TX 
LDA 
LDX 
INC 
CMP 
BNE 
STX 
INC 
CMP 
BNE 
STX 
INC 
CMP 
DNE 
STX 
LDA 
INC 
CMP 
BNE 
INX 
STX 
LDA 
LDX 
RTI 
LDA 
LDX 
RTI 
BRK 
BRK 
BRK 
BRK 
BRK 



$05 
$06 

*$3C 

**00 

$04 

$04 

$0330 

$04 

$03 

$03 

$0330 

$03 

$02 

$02 

$0330 

$02 

#$0D 

$01 

$01 

$0330 

$01 
$05 
$06 

$05 
$06 



SAVE A nUB X 
A:=--60 DECIMAL X=^0 

COUNT 1/60 SECOND 

FULL SECOND YET? 
IF NO THEN RESTORE REGISTERS & RETURN 
RESET 1/60 SECONDS 
COUNT 1 SECOND 

1 MINUTE YET? 

MINUTES 



SET A^* HOURS IN 1 DAY PLUS 1 

HOURS 

FULL DAY? 



SET INTEBRUF'T 



,H,h,S 



20 POKE 
30 POKE 
40 POKE 
AZ POKE 



2, a 

3jS 
4»0 



IF YES SET HOURS TO 1 
RESTORE REGISTERS 

RESTORE THEM HERE TOO 




LISTING 2 
PROGRAM #3 

>LIST CLOCK DfUVER 

5 PRINT CIIR't.<'i);TiLOAri CLOCK' 

7 POKE io:;o»o: poke 10:11,2: rem 

VECTOR 
10 INPUT "INPUT TIHE - 
15 REH SET CLOCK 
1-H 



15 f1= PEEK (-16296): REH TURN CLOCK ON 
47 INPUT "12 OR 24 HOUR CLOCK" > A: POKE 801rA+l 
43 REM SEE LISTING FOR EXPLftlNATION OF LINE 
50 CALL -936: REM CLEAR SCREEN 

60 VTAB 10: PRINT ■ 

61 REM ERnSE OLD TIME 
70 VTflB 10: TAB 10 

75 REM DISPLAY CURRENT TIHE 

80 PRINT PEEK (lH":'f 

81 REH HOURS 

90 IF PEEK (2X10 THEN PRINT "0' 

91 REM MINUTES 
100 PRINT PEEK (3>t PEEK (4): GOTO 60 
110 RLM SECONDS AND 1/60 SECONDS 



47 



PRINT PEEK (2) J 



FOR APPLE 2 
& APPLE 2 Plus 



MAN&TaiA. 



A REAL TIME HI-RESOLUTION GRAPHICS GAME 

WITH SUPER SOUND EFFECTS. THREE 

SKILL LEVELS- NOVICE, AVERAGE ("Arcade" 

difficulty") and EXPERT WHERE ASTEROIDS ARE 

ACTUALLY ATTRACTED TO YOUR SHIP ! 



MAMttAI 

formerly ' ' ASTE ROID " n T M Q 

Now Available 

32 K TAPE $14.95 
32K DISK $19.95 

From Your Local 

Computer Store 

Or Send Order to 



OcopvTiatii 1380 

dventur^ 



tk DIVISION or SCOTT ADAMS, INC 




lONGWOOO (LA 32 7'jO 



305. 862-6917 



72 



COMPUTE! 



February. 1981. Issue 9. 



FIGURE 3 



NMI ^ 




<(^ 3 — y 



o 

o 
o 
o 



O O 



GAME I/O 
-ANNUNCIATOR 




-<60Hz 



only extra part required is a 7400 or 74LS00 nand 
gate. It is wired according to figure 3 using a pro- 
totype board, an off-board wire wrap socket, or the 
breadboard area on the Apple board. Even the revi- 
sion 1 boards have room for two IC's in the right 
hand corner under the keyboard, NOTE: To wire 
the modification in this way requires removal of the 
Apple board and will probably void your warranty. 
Check with your local dealer. 

The connection to the game I/O connector is 
made using a piece of stiff wire such as the lead of a 
small resistor. This wire is inserted into the connec- 
tor and bent as shown in figure 4. A 16 pin IC 
socket with one pin clipped to accommodate the wire 
is inserted over that and the game paddles are 
plugged into that socket. Many connections can be 
made to the game connector in this manner without 
having to clip pins off of the game paddles. 

FIGURE 4 



WIRE 



1 



GAME PADDLES 

• SOCKET 

GAME I/O CONNECTOR 



EDGE VIEW 



The Disadvantages 

Unfortunately, every silver lining comes equipped 
with a cloud and the 25 cent clock is no exception. 
The main problem is that the disk and tape will not 
work, as well as other programs which involve 
precise timing. The interrupts must be disabled, 
either manually or under program control, while 
such programs are running. 

Another hitch is in the computer control circuit 
itself. When an Apple is turned on, the annunciator 
outputs are high (logic 1) so this has been made to 
disable the interrupts. An autostart rom however, 
turns all the annunciators to logic 0. Before this hap- 
pens all the annunciators are still at logic 1 for a few 
milliseconds so inverting the signal from the annun- 
ciator will still leave the interrupts enabled for 
enough time to cause an interrupt and a system 
crash. Therefore, the interrupts must be disabled 
manually upon power up with an autostart rom. 

Another problem is that the bell tone sounds 
raspy. This isn't serious, but it can get on your 



nerves after a while. It doesn't make a good way to 
check if interrupts are enabled. 

The final problem is that the clock seems to lose 
about ten seconds each hour. This can be remedied 
by adding ten seconds to the seconds counter each 
hour. 

Fringe Benefits 

The 25 cent clock is remarkably user proof. The 
NMI line doesn't require debouncing, and resetting 
the comupter doesn't interfere with its operation 
either (unless the reset key is held down for a long 
time). 

The two main dangers of system crashes are 
working on the interrupt handler while interrupts are 
enabled, and not saving registers. THIS IS IMPOR- 
TANT!!! You must save each register you intend to 
modify. If you do not you will get very mysterious 
results. You can save registers in memory or you can 
push them onto the stack. There is also a routine to 
save and restore all registers in the monitor. 

Once these restrictions have been met, the 25 
cent clock opens a vast new horizon of features that 
would cost tens of dollars if bought from vendors. The 
price you pay is speed. The longer the interrupt 
routine, the slower the computer runs. This is not a 
severe handicap. The clock routine does not slow the 
computer down enough to be perceived, even when 
the interrupts are switched on and off for com- 
parison. In order to slow the computer down by even 
one percent it requires a one hundred instruction 
routine. 

Some things that can be done include: 

Control Of Computer Speed Using Game Paddles: 

have the interrupt driver pause according to the posi- 
tion of a game paddle to give control of listing speed, 
how fast a program runs, etc. 
Keyboard Buffering: have the interrupt routine 
sample the keyboard and store any keypresses in a 
buffer to give storage of multiple keypresses while 
something else is going on. 

Mixing Display Modes: sixty times a second switch 
to another display mode to mix text and graphics, or 
mix two graphics modes for extra colors. 

The possibilities arc endless. You can even run 
two programs at once using the interrupt. The 
twenty-five cent Apple II real time clock is a lot more 
than just a clock, it's a cheap way of doing a lot of 
expensive things, right in line with Apple tradition. 



February. 1981 Issue 9. 



COMPUTE! 



73 



GLOSSARY 

INCREMENT- to add 1 to a counter 

INTERRUPT HANDLER- a machine language 

program which is executed whenever an inter- 
rupt occurs 

INTERRUPT VECTOR- the address of the 
interrupt handler routine 

IRQ- Interrupt ReQuest; an interrupt line which can 
be disabled under program control 

NMI- Non Makable Interrupt; interrupt line which 
cannot be disabled 

REAL TIME CLOCK- a device which provides 
a computer with information about the 
time without disrupting the computer's 
normal functions 



Apple Monitor Extender 




APPLE 11 16K, CASSETTE 

This utility program works in complete harmony with the Apple 
monitor to extend your computer's capability and help you use 
the lull power ol machine language programming. 

Screen display shows memory in HEX, ASCII or BINARY. Move 
data anywhere in memory without regard to direction or overlap- 
ping and read or write any sector on disk. Insertions may be in 
HEX or ASCII so you can easily format high speed text displays 
without conversions. 

Study,, modify or disassemble any program, complete with 
labels. Several programs may be combined, and the entire 
disassembled text lile stored on disk/tape for later assembly. 

The slow listing feature steps through listings with ease. 
iCopyrlght 1B80 Glonn R. Sogge, All Rlghls Resarvad. 

I rnMM ITCP 61 S Academy Drive 

liSuSCl^SS^ Northbrook, IL 60062 
■PRODUCTS 312/564-5D60 



I 



lUlLNTINeirCN 

CC/HIPiLTINe 



PH0OH*MS USTtD BELOW ARE ON DISK: 



5J4 95n 



SJOOOj. 
S24 9Sn 



Apple Galajiian 

EPYX jAutomaled Simuli»l«ns) SPECIAL — 

While Ihey lasl Ryo/Moitoc/riigei an trrw 

Galaxy Wars 

Soice'ef /Doom Cavern 

Hyper Head-On 

Galaciic En^pire - - 

GaiadcTfader SJ4 95 "o- 

Galacln; RevoluIKXl - S24 95 HO" 

Golden p^cunlain , 5i995iw» 

TankCommaiW SU 95 «- 

DBMaslef $18900™. 

Bloody Murder $19M™« 

Tranquilily Base 5219ino« 

Arisiotie s Apple S3d9^rto« 

MicroMenw S39 95 ™ 

Trie Dala Factory - - SlSOOOno- 

Wission Aslefonj - - S^99S«w 

Viriyl nolOers fof 20 disks m 

beEyijIu! delune padded binder , 

Skybon-bersll Sl996~~ 

Apple-Doc S2495W- 

Progiammers Ulilily -. - , .$16 95 new 

DOSToolKll $7500ni>.« 

Microsch AdvenlLjre ' '■■■ S2995npw 

Olympic Oecathlon $^^ ^ "'*"' 

Compu Matr^ Ariirimetc - " £49 55 no- 

AppieFiol SJ5C0™. 

Wemor&x disks - Ten lor ,. ■ 

College Boairls {Krell] - - - - S79 95 oo* 

TimeTrayelei S24 95 no- 

SwoJd of Zedek S24 95 n™ 

All Time Super Slar BaseCall Sl-l 95 >»« 

CnAEaO $a4 95"cn. 

MCAT20 $1995n» 

Trie Tafiunan S2495no- 

Ti PBCCRAMMER — Ho«ic«jmal/Oclal Calcularar 

Retail S65 00 ■■ - ***" 

WPI @6G Prir^ler 

We ioll the complete lins ol Btlt and Howell Apfilt 
ComputifS - Wffi* 01 all lor qiyoles- 
The Prsoner 

The Wizard & The Princess 
Campu-Spell 



111.** 

(**.« 
in.** 

III.** 
•ai.» 
111.1* 
lai.i* 
Mi.M 
*i*.*> 
111.** 
ti**.** 

tlT.*« 
»!».** 

*a*.** 
tii.t* 

1I14.** 
1)T.*« 

ltl.<* 

IIT.** 
Ill,** 
III.** 
•**.** 
• M.*< 
fU.*< 
1«4.*9 
«**.<« 
l».*f 
(«*.*> 
«».** 
»«.** 
111. I* 
tll.t* 
HT.»* 
$11.** 

$>«.*« 

$«**.*« 



9 
B 
B 



Compuler Ambiish 
Cnmpulei Bismark 



S29 95 fw* 
S32 95 im, 
539 35 no. 
559 95 now 
559 95 now 



Compute.' Napoleoftics , - - ^59 95 r 

CompuerQuarterdack - S39 95 n 

Fligh! StmLjIatorldisk) - $34 95 r 

Star Courser 
Space Altiurh 
Oity&sey 
Boiri Barrels . 
Modiliable Database 
Migto i_eag je Baseball 
SargoTll 
Program Lrne Ediioi 



S24 95 rxM* 

$39 95rH)- 

S29 95 «» 
S24 95 n<« 
$79 50 flow 
, S24 95 now 
S34 95 ™- 
WOOO 



(ia.t* 
|».t* 
IM.** 
tJJ.*» 

$I1.«9 
111.** 
!».** 

S]*.se 

lu.** 

• 14.50 

tu.*« 

«M.** 

111.** 

tif.ie 
»*«.»* 



Z-SOSoftcatdwilhCP/M - - $349 00 00. *1**.M 

V,de«80-Col BoarD 535000oo. 

EZDraw S3495no. 

HeadOn - $249500. 

SDGrapnis $3995oo. 

Comp^Malhlorll !!!???™' 

Apple world 
A6M IMuse) 



$59 95 now 
$24 95 ™- 



Dala Plot (Muse) $69 95 n 



$39 95(1 
$59 95 o 
S29 95 
$29 9S» 
S19 95" 



Compuler Conllict 
Compuler Air Comoal 

TerroTST 

The Temple ol Apshai 

Motioc 5 Towe^ 

3uoer-Te»tll 

fylagic Window 

Desktop Plan 

CCA Dala Management 

Visicalc 

Acan: Fortune-leliing 

Horrible scope 

CytDer Sirske - - 

HI.RES FDOlOall lOn-Line) -.-. ??' ?? 

Fasigammon 

Trie Voice 

Helltirc Warnor 

Beneaiti Apple Manor 

Astrc Apple 

Akalabelh 

Ar-JDROMEDA 16K RAr^ Expansion Board lor Apple II 

Retail IS $195 — Our prce 
NEC t2 (^reeniBlack 

Centronics 730 Printer - - - - - 

Centronics 737 Printer .. ... 

ABT Pad lot Apple -- — 

ROM- w tiitet 

M4P SO col Video Card 

Veisawriier . - 



t]**.H 
$1».»* 

•la.** 
!».** 
JMei 
fll.** 
»lJ.«t 
»J3.»* 
fJ9.** 
»«.»♦ 
til .41 
«U.4J 
lit.** 



$249 rraw |ll*-*0 



n 



2D20Cnaries.CQfcoian CA93212 

24-iioij; QrdCT si?riice Call 
09:992 5-111 Sericl'orireecala^og 



SlSOOOno- 


ttJ*.*l 


U 


$99 96 no. 


«a9.«« 


I 


S99 95 no- 


(•s.ac 


599 95 no. 


«».*« 


SlSOOOno- 


tiit.e* 


9 


$1 E 00 r»w 


«a.»* 


51500 r™ 


$>l.*) 


539 95 rw- 


«».** 




$39 95 rvjw 


»».»* 




524 95 (»- 


(ll.» 




539 95 no. 


• 19.** 




$29 95 r»- 


11S.41 


$20 00.ow 


1IT.4J 


$20 00 ro- 


$11.41 




534 95 -KB. 


SI*.** 

11*4.** 




=260 now 


tll».»o 




S795r», 


tut.o* 


5995 rx!- 


lT**.e* 


$125 rvi. 


ti«*.ea 




SjOOoo. 


»).'•■•• 


$375 "o. 


lll^.O* 



i;appk:5or,w.. ^\^^upto40% g 



OFF LIST 

We lake MasterCard or VISA ilnciude card * and e,piration dalel Cai'loma residents add 6*» 
lax Include 52 OO lor poslage 55 00 Foreign Mail lo _ 

HUHTIiiaTeM CeMNTIHS. Oept CaM-2 Q 

a 



Q 



Biiasiasisi 



74 



COMPUTE! 



February, 1981 issue 9, 




Ticker Tape Atari iVIessages 



Eric Martell and Chris Murdock 
The Education Connection 
Boulder, Colorado 



The large text modes [GR. 1, GR.2] are very conve- 
nient. With text like this available, the Atari can 
become a useful and eye catching message presenta- 
tion device. The following program makes use of 
some simple string manipulations, to move text 
across the screen in a manner reminescent of ticker 
tape or a marquee sign. The actual text movement is 
done by line 50 in the following manner: 

The first 19 characters of the message string 
[AS] are printed at position 1.5 [the vertical center of 
the screen]. A temporary string [C$] is set equal to 
the second through the 20th characters in A$. Then 
A$ is added [concatenated] to C$. Since C$ and A$ 
are dimensioned to be the same length, this has the 
effect of attaching the first character in A$ to the end 
of C$. A$ is then set equal to C$ and printed once 
again . 

The variable K is set up to check for any key 
being pressed. This action will terminate the pro- 
gram in line 55. A delay loop is inserted in line 55 to 
increase readability, since the string manipulation is 
so fast that the letters become blurred unless slowed 
down. 

The rest of the program contains enough 
remarks to be self explanatory. 

The Ticker Tape Program 

REM MOVING MESSAGE PROGRAM FOR THE 
ATARI 

1 ? "esc-shift-cIear":REM CLEAR SCREEN BEFORE 
GOING ON 

9 REM DIMENSION STRINGS 

10 DIM X$[jlOOO],B$il|,W$|20],PJ[201,Yt[20].Z$[20] 
15Wt = " ":REM 20 SPACES 

19 REM CLEAR STRINGS AND SET B$ = BLANK FOR 

CLEARING THE REMAINDER OF X$ 

20 XJ = "":B = " " 

24 REM INPUT YOUR TEXT HERE 

25 ?:? "ENTER YOUR MESSAGE";:INPUT X$ 

29 REM CLEAR THE REST OF XJ IF SHORTER THAN 

SCREEN WIDTH [19] 

30 IF LEN[X$j<20 THEN FOR C = 1 TO 20-LEN[X$]: 
X$|LEN[X$] + 1] = BJ:NEXT C:X$[LEN[X$] -i- 1] = B$ 



35 DIM AJ[LEN[Xtl],C$[LEN[XS]]:A$ = XS 

39 REM GOTO GRAPHICS MODE 2 + 16 AND PRINT 

STRINGS 

40 GRAPHICS 18 

45 REM MOVE BORDERS OF STARS 

46 POS. 1,3:? #6;W$[1,I9]:P$ = WS[2]:PS[LEN[PS] + 1] = 

WS:WS = PS 

47 POS. 1.7:? #6;Y$[1,19J:Z$ = Y$[2]:ZS[LEN[ZS] + 1] = 

Y$;YS = Z$ 

49 REM MOVE MESSAGE STRING AND CHECK 

LOCATION 764 TO SEE IF A KEY WAS STRUCK 

50 POS. 1,5:? #6;A$[1,19]:CS=AS[2]:CS[LEN(CS] + 1] = 

AS:AS = CS:K = PEEK[764] 

54 REM PAUSE TO INCREASE READABILITY, SET 

COLOR RANDOMLY, AND RESET ATTRACT FLAG 

55 FOR TI = 1 TO 50:NEXT TI:POKE 77. 0:SETCOLOR 

INT[RND[0]'4],INT[RND[0]*15],8:IF K = 255 
THEN 46 

Additional Goodies 

For those people who would like to discourage exit 
from their programs by means of the Break key or 
the System Reset key, here are three memory loca- 
tions which can be poked to accomplish this task. 

The Break key interrupt routine seems to begin 
and end in ROM, but is vulnerable when it passes 
through RAM. If you POKE 16,64 and POKE 
53774,64 [this resets the Break key enable bit], you 
will find that the Break key will no longer respond 
until the locations are poked with 192, the program 
changes graphics modes, or the System Reset is 
pressed. 

The System Reset key is not vectored through 
RAM until after it does a number of irrcversable in- 
itializations and so is more or less impervious to 
attempts to disable it. However, the reset routine 
does look at a flag in location 580. If you POKE 
580,1, or any non-zero integer, you can fool the 
computer into thinking that a System Reset impulse 
is a cold start. The major effect of this trick is to 
erase everything in RAM. Needless to say, having to 
reload a program once or twice is an effective deter- 
rent to use of the System Reset key. q 



Februorv, IVSl Issue 9- 



COMPUTE! 



75 



Atari Colors 
And Sounds 
With Paddies 



Arthur Schreibmon 

The Atari computer has excellent graphics and sound 
capabilities. With 16 colors and eight levels of 
brightness we can generate 128 different colors. 
There arc 256 notes available, each with 8 distortion 
values, totaling 2,048 sounds. Each color or sound 
can be accessed by a unique combination of numbers 
used in the SETCOLOR or SOUND statements. If 
you want to use a specific color or sound in your 
program, the problem is to find the correct values to 
use in the Basic statements. 

The programs below enable you to see every col- 
or and hear almost every sound while also displaying 
the accompanying values used to generate them. 
These programs are also instructive in the use of the 
Atari paddles. 

10 REM ATARI COLORS WITH PADDLES 

20 GRAPHICS 3 

30 POKE 752,1 

40 COLOR 1 

50 A = PADDLE (0) 

60 B = PADDLE (1) 

70 SETCOLOR 4, INT (A/IS), 2' INT (B/30) 

80 PRINT "COLOR = "; INT (A/15), 

"BRIGHTNESS = "; 2* INT (B/30); " " 

90 PRINT " t t " 

100 GOTO 50 
One paddle will change the screen color while the 
other changes the brightness. The numerical values 
used in the SETCOLOR statement are shown in the 
text window. 

In the above program, line 30 surpresses the 
cursor. The two divisions in line 70 break the 228 
positions of the paddle into 16 and 8 different posi- 
tions, thereby using the full range of the paddles to 
display all 16 colors and 8 levels of brightness. The 
blank at the end of line 80 holds the space when the 
value changes from 2 digits to 1 . Line 90 uses control 
characters to print line 80 in the text window only 
once. They are entered into the program by pressing 
the ESC key and then the CTRL key and i key 
simultaneously. The last line sends the program back 
to line 50 where it waits for a change in the value of 
the paddle. 

10 REM ATARI SOUNDS WITH PADDLES 

20 N = INT (1.12 * PADDLE (0) ) 

30 D = 2 • INT (PADDLE {l)/30) 

40 PRINT "NOTE = " ;N;" DISTORTION = ";D 

50 SOUND 0, N, D, 8 

60 IF INT (1.12 • PADDLE (0) ) < > N THEN 20 



70 IF 2 * INT (PADDLE (l)/30) < > D THEN 20 

80 GOTO 60 
In the above program, one paddle changes the notes 
while the other changes the distortion. The numerical 
values used in the SOUND statement are shown on 
the screen. The SYSTEM RESET key turns the 
sound off. 

Since there are only 228 paddle positions and 
256 notes, we cannot access every note with this 
method. The 1.12 factor in line 20 allows us to hear 
the full range of notes while skipping some notes 
along the way. Line 30 generates even numbers from 
to 14 for the distortion value. Lines 60 and 70 wait 
for changes in the paddle values. 

These two simple programs can be quite useful in the 
writing of other programs, and more fun than using 
trial and error to pick colors and sounds. ^ 



Atari As 
Terminal 

A Shiort Communications 
Program 



Henrique Veludo 
N.Y.C, N.Y, 

Here is a short, unsophisticated (it has no provisions 

for a printer, etc.) program to convert the ATARI 

into a terminal for communication over the telephone 

with a remote computer system such as the 

MICRON ET data bank, using the ATARI modem 

and 850 Interface Module. After it is entered and 

RUN, it can be exited with the BREAK key (this 

will close all devices and reset parameters). 

Lines 50-40 open the keyboard and RS232 devices. 

Line 40 starts the Concurrent I/O Mode. 

Line 50 gets characters from the keyboard and sends 

them. 

Line 60 checks for an empty buffer. 

Line 70 gets characters from the buffer and prints 

them. 

Line 80 checks if a key has been pressed, and if so, 

directs program to send the character. 

10 ? " ]": POKE 82,0 

20 OPEN #1,4,0,"K: 

30 OPEN #2,13,0,'^R: 

40 XI0 40,itf2,0,0,"R: 

50 GET#l,A:PUT#2,A:POKE 764,255 

60 STATUS#2,R:IF PEEK(747) = THEN 80 

70GET#2,B:? CHRS(B); 

80IF PEEK(764)<>255 THEN 50 

90 GOTO 60 © 



76 



COMPUTE! 



February. 1981. Issue 9 



Character 
Generation on 
the Atari 

Charles Bronnon 
Greensboro, N.C 

This article is a tutorial on a little-known feature of 
the Atari microcomputers -- the ability to re-define 
the character set. The character set is the group of 
255 alphanumeric characters that can appear on the 
screen. It comprises the upper and lower case 
alphabet, the numbers, special symbols, and punc- 
tuation. Also included in the Atari character set are 
29 "control graphics" characters. When the CTRL 
key is held down and a letter of the alphabet is 
typed, the corresponding graphics symbol is 
displayed. These symbols are much like those found 
on the PET. Unlike the PET, however, the Atari can 
re-define any of these characters. This allows custom 
graphics, uscr-dcfmed special symbols (like pi, theta, 
or foreign language alphabets), and logos, 

There is no built-in command to perform the 
changes; it has to be done the hard way with PEEK 
and POKE. These are commands to look at and 
modify memory, respectively. First of all, you must 
understand how the Atari stores and displays these 
characters. It is beneficial if you know how to work 
with binary numbers, but it is not a prerequisite. 

Start out by designing your characters. Fill in 
the blocks on an 8x8 grid; each block will represent a 
pixel (picture element, dot). Observe the "A" in 
figure one. Notice the heavy vertical lines. A televi- 
sion screen will display horizontal lines brighter than 
vertical lines, so it is necessary to have two vertical 
lines in order for it to be clearly visible. Therefore, 
the "pi" in figure two may be hard to see unless 
enlarged in grapics mode 1 or 2. 



Figure one 

1 

2 6 3 1 

84268421 



Figure two 

1 

2 6 3 1 

8426S421 



126 
164 




After you have designed your characters, you 
have to convert them to the numbers that a computer 
loves. Each row in your grid represents a binary 
byte. A filled in block represents a 1 and a blank 
one means 0. Hence, the top row of the "A" is 
00011000 or 24 decimal. Now write the bytes for 
each row. If you do not work with binary numbers, 
you can convert each line in the following manner: 

1. Notice the numbers above each column. They are the 

powers of base two. 

2. If a block is filled in, take the number above it and add it 

to a "Sum". Sum up all the blocks in the row. (e.g. 

the fourth line of the "pi" would be 128 +32 +4 = 164) 

3. Do this for all eight rows. 

Next, assemble the numbers into DATA statements. 
The numbers for "pi" would then look like this: 
1000 DATA 0,1,126,164,36,36,36,36 
Finally, you have your numbers. Now all you have 
to do is replace the numbers of the character you 
want to re-define with your numbers. Unfortunately, 
this table is stored in ROM, so it can not be altered. 
The solution is to copy this table into RAM memory, 
which can be changed, and then tell the computer 
where you have moved the characters to. 

The first part of the program would then look 
like this: 

10 ROM = 57344: REM START OF ROM CHARACTER 

TABLE 
20 RAM = 8192 : REM HIGH UP IN MEMORY 
30 FOR r = TO 1023 
40 POKE RAM + I, PEEK(ROM + I) 
50 NEXT I 

The transfer takes about 15 seconds, a seemingly 
LONG time. It need not be executed more than 
once, unless you go into a GAPHICS mode greater 
than 3. 

The next line: 
60 POKE 756,32 :REM 32*256 = 8192 
Now that the table is in RAM, we can now find the 
place in it for the new numbers. Look up the 
character you want to replace in table 9.6 -- Internal 
Character Set, on page 55 of the Atari BASIC 
Reference Manual. Write down this number as well. 
Notice that it is not the ATASCII value of the 
character. Include this number preceeding your eight 
bytes in the data statements. For our "pi": 
1000 DATA 32, 1,126,164,36,36,36,36 
A few more lines, and the program is finished: 
65 READ NCHR :REM NUMBER OF CHARACTER TO 

BE RE-DEFINED 
70 FOR I = 1 TO NCHR 

80 READ RPLC; REM CHARACTER TO BE REPLACED 
90 FOR J = TO 7 
100 READ A 

110 POKE RAM + 8* RPLC + J, A 
120 NEXT J 
130 NEXT I 

140 REM FOLLOWING LINE IS OPTIONAL 
150 FOR I = TO 255: PRINT CHRJ(27);CHRS(I); : 

:NEXT I :REM DISPLAYS CHARACTERS 
160 END 
999 DATA 1 :REM NUMBER OF CHARACTERS TO BE 

RE-DEFINED 



February. 1981 Issue 9, 



COMPUTE! 



77 



SOFTWARE FOR THE ATARI 800 
AND THE ATARI 400* 







TARl TREK'" 

By FabtD Ehrengruber 

Get ready for an eicitrng trek through space. Your 
mission IE 10 rid the galaxy of Kiingon warships, and to 
accomplish this yoy must use strategy to guide the star- 
ship Enterprise around stars, through space storms, and 
annidst enemy fire. Sound and color enliven this action 
packed version ol the tfaditional trek game. Nine levels of 
play allow the player to make the mission as easy or as 
challenging as he wishes. At the highest level you are also 
playing against time. Damage to your ship can be 
repaired in space at a cost ol tine and resources if you 
can't make it back to base, TARl TREK gives you a lot of 
trek at a low price. This program is written entirely in 
BASIC and requires at least 24K of user memory. For the 
Atari 800 only. 

Cassette ■ Jl 1-95 Diskette - J14.95 




FASTG AMNION'- 

By Bob Christiansen 

Play backgammon against a talented computer oppo- 
nent This IS the latest and best version of the most popu- 
backgammon-playing program for personal computers ■ 
FASTGAMIvtON Roll your own dice or let the computer roll 
them lor you, Ad|ust the display speed to be last or slow 
If you wish you can play a game usingthe same dice rolls 
as the previous game - a great aid in improving your skrlls 
at backgammon Beginners find it easy to learn backgam- 
mon by playing against the computer, and even very 
good players find it a challenge to beat FASTGAMMON. 
The 12-page instruction booklet includes the rules of the 
game. Written in machine language. Requires only 8K of 
RAM and runs on both the Atari 400 and the ASari 800 

On cassette only ■ UBM 




TANK TRAP 

By Don Ursem 

A rampaging tank tries to run you down You are a combat 
engineer, building concrete barriers in an effort to con- 
tain the tank Use either the keyboard or an Atari joystick 
to move your man and butid walls. If you trap the tank you 
will be awarded a rank based on the amount of time and 
concrete you used up. But they'll be playing taps lor you 
if you get run over. There are four levels of play. Higher 
levels of play introduce slow curing concrete, citizens to 
protect, and the ability of the tank to shoot through any 
wall unless you stay close by, Ivlusic, color, and sound ef- 
fects add to the excitement. Written in BASIC with ma- 
chine language subroutines. Requires at least 16K of user 
memory Runs on the Atari 800 and on an Atari 400 with 
16K RAM. 

Cassette - jn.95 Diskette - J14.95 



OS FORTH- By James Albanese, Step into the world of the remarkable FORTH programming language Writing programs in FORTH is much easierthan «''''"2'^™ in as- 
sembly language yet FORTH programs run almost as last as machine code and many times faster IhanlASIC programs, QS FORTH is based °" /i8'™.RJ^ ."l^,R°P" f,^°^;' 
from, the FORTH fnlerest Group tM has become a standard for microcomputers. QS FORTH IS a disk-based system that can be used with upto four disk drives. There are fi« 

modules included: 

1 The FORTH KERNEL (The standard tig FORTH model customized to run on the Atari computer). 
2, An EXTENSION to the basic vocabulary that contains some handy additional words. 

3 An EDITOR thai allows editing source programs (screens) using Alan type editing 

4 An lOCB module that makes I/O operations easy to set up. 

5 An ASSEMBLER that allows defining FORTH words as a series of 6502 assembly language instructions. 
Uodu\es2-5 may not have to be loaded with the user's application program, allowing for some efficiencies in prograraoverbead Full error statements (not |usl numerical 
des are printed out, including most disk error statements. QS f5rTH requires at least 24K of RAM and al least one disk drive. For the Alan 300 onfy. 



codes) are printed 



On diskette onfy - $79.95 



ASSEMBLER by Gary Shannon. Write your own 6502 machine language programs with this inexpensive m-RAM editor/assembler. Use the edrtor to create and edityou 
Tsser^bleTsource code Then use the assembler to translate the source code into machine language instructions arid store the code in memory, Simp^^^^^^^ 
sa^nd load the source code to and from cassette tape You can afso save any part of memory on tape and load it back into RAM at the same or at a different oca lO^Te 
as embfer handles all 6502 mnemonics plus 12 pseudo-ops that include video and printer control Commenting is a lowed and ^""'^hsckingis performed A ve y usefu 
feature allows you to view and modify hexadecimal code anywhere in memory. Instructions on how lo interface machine language subroutines to your BASIC programs are 
included, ASSEMBLER requires 16K ol user memory and runs on both the Atari 800 and the Atari 400 

On cassette only ■ J24.95 

eS02 DISASSEMBLER by Boh Pierce This neat 3K BASIC program allows you lo disassemble machine code, translating itand listing it m assembly language fotmaton 
fhevfdeo and on trprinter, I you he one 6502 DISASSEMBLER^an be used to disassemble the 

srar^s located an where in RAM except where the DISASSEMBLER itself resides (Most Atari cartridges are protected and cannot be disassembled usingthi disassembler^ 
Lowo?ks as anS interpreter, translating machine code into ASCII characters, 6502 DISASSEMBLER requires only 8K of user memory and runs on both the Atari 800 
and the Atari 400 

Cassette ■ J 11. 95 Diskette ■ 514.95 




Qu;!iLrTy softwtirg 

6660 Resecia Bivd . Suite 1 05. fJeseda. CA 91 335 
(213)3'MHi5W 



WH ERE TO G EI IT: Call us al (2 13) 311 -6599 for the name ol the Q ualily Soltwaredealer nearest 
you II necessary you msy order directly liom us Mastercard and Visa cardholders raay place or- 
ders liy lelephooe Or mail your check or bankcard number to Quality Sollware, 6660 Reseda 
Blvd Suite 105 Reseda CA91335 California lesidenls add 6'-.- saiestai SHIPPING CHARGES: 
Wilhin North America orders must include SI 50 lor lirsl class shipping snd handlinj Outside 
North America Ihe charge lor aiimail shipping and handling is S5 00 Pay n U.S currency 



•Indicates trademarks ol Atari, Inc, 



78 



COMPUTE! 



February, i981. Issue 9. 



A few program notes: 

1. You can use multiple statements per line and 

squeeze the program into less memory; delete 
REMs if you like. 

2. This program should be appropriately renumbered 

for use as a subroutine 

3. VERY IMPORTANT: 

This is not the only way to accomplish the 
changes in the character set. Also see "Card 
Games in Graphics Modes 1 and 2" and the 
program on page 69 in COMPUTE!, 
November/December, 1980. 
EXPERIMENT! 

4. Entering any GRAPHICS mode will reset the 

pointer to the table (Une 60). Any time you 
enter a new text mode, re-execute POKE 
756, 32. 

The complete program, and a utility program that 
lets you look at characters wrap up this article. Study 
them, puzzle them out, and get down to business! 
Happy POKEing! 



Program to re-definc characters 

10 R0M=57344: REM :;TflRT OF ROM CHRRHCTER TFiELE 

20 RftM=S]L=i2 :REH HIGH UP IH MEMORY 

50 FOR I-Q TO 1023 

40 POh^E RHN+I.. PEEKtROM+i:;' 

50 NEXT I 

60 POKE 756 ..:32 -REM 32^25<i-S.192 

65 REFiri NCHR ^ REM # OF CHhRhCTEP-; 

70 FOR 1 = 1 TO fJCHR 

;36 RERD RPLC REM CHflRflCTER TO BE REPLRCED 

■3d FOR J=»3 TO 7 

100 RERIi fl 

110 POKE RRM+S:*RPLC+J, fl 

12'0 NEXT J 

130 NEXT I 

140 FOR 1=0 TO 255:pRINT CHR*(£7>.; CHR*a .> ; 

^NEXT I REM DISPLflVS CHRRflCTERS 
150 END 

160 REM DhTh FOR CHHRfiCTER:3 FOLLfiWS; 
i<ERIiV. 



Program to view characters in ROM. Note that the 




characters appear in GRAPHICS mode 4 ! 




10 GRRPHIC.:3 4 




20 SCR=PEEK<560:)+25e*PEEK<5en+4 




30 :;CR=PEEK'::;CR>+256*REEK(£CR+1J 




49 PRINT "CHRRRCTER #? (0-127'3": 




50 INPUT CHR 




60 IF CHRC0 OR CHRM27 THEN 48 




70 PRINT #6: CHR* a 25:).; 




S0 FOR 1=0 TO 7 




90 POKE SCR+4+10*!.. PEEK';57344+CHR*S+I > 




100 NEXT I 




110 GOTO 40 




!?EflDV. 


© 



The Atari Hall 
Of Fame: 
iridis, 
Founding 
Member 

Craig Patchelt 
Greenwich, CT 

Having followed the evolution of TRS-8G software 
quality from poor to not-so-bad, I expected to have 
to go through the same evolution when I upgraded to 
an Atari 800. The people at The Code Works have 
proven me wrong. They publish an ongoing "Atari 
Tutorial" called IRIDIS which, in this reviewers 
opinion, is quickly bound for Atari stardom. 

I tried numerous times to write this review to 
cover everything about IRIDIS that I thought 
deserved to be covered. Each time I thought of more 
things that I should have included. Eventually, out of 
desperation, I ended up making this outline so that I 
wouldn't forget anything. Then I thought, "aha(!), 
they (as in you) don't want to wade through 
unccessary verbosity (what you're reading now), so 
I'll just give them my outline." So, without any fur- 
ther uneccssary ado (what you're reading now), 
here's that outline: 

Iridis 

Details: 2-4 programs each 'issue" (so far). 

16K needed for each program for cassette, 24-K for 

disk. 

Each issue consists of one cassette/disk and 1 u.ser's 

guide. 

A User's What? 

The User's Guide is a booklet (32-56 pages) con- 
taining: 

Listings of each program. 

Complete explanations of each listing, including an 
explanation of every line and every variable, and 
averaging 3!^ pages long in the first issue, ten in the 
second. And ten very understandable pages at that! 
Hacker's Delight: explanations of various Atari 
mysteries, such as display lists and 23 very in- 
teresting memory locations in the midst of the Atari 
memory jungle. 

Novice Notes: for those of you who thought "so 
what?" or "huh?" to the description of Hacker's 
Delight, Novicer Notes explains, in very simple 
terms, such things as bit patterns (3Vj pages) and 



February, 1981. issue 9, 



COMPUTE! 



79 



String manipulation (2J4 pages). 
Oddments: "Facts, Fancies, and Rumors." 
The Oracle: questions to ihe editor. 

So what are these programs, anyway? 

IRIDIS 1: 

CLOCK: a clock wiih hands, and ticking, and 

cliimes, and everything! 

ZAP: a one player "chase" game. 

LOGO: an interesting demo program. 

POLYGONS: an even more interesting demo 

(remember Spirograph? Well . . .) 

IRIDIS 2: 

FONTEDIT: design your own Atari character sets 
with this feature packed character set {or "font") 
editor. Work with an 8X enlargement of a character, 
and see it in it's regular size at the same time. Fonts 
can be saved to tape or disk, and can be used in 
your own programs using an included BASIC 
subroutine. 

KNOT WORK: an interactive demo program involv- 
ing "cellic interlace" and using a custom designed 
font. This one tends to defy a simple description, so 
I'll leave it as a (pleasant) surprise. 

Anything else? 

For those people sick of sending away for programs 
and then having to wait for weeks before finally 
receiving them, you might be pleased to know that I 
mail ordered both IRIDIS' and received them both 
in about a week! Kee[) up the good work Code Works. 

What's your point? (As if I haven't aiready 
guessed) 

Buy these programs. IRIDIS 2 should be as much a 
part of your [programming library as your BASIC 
cartridge is. IRIDIS I also contains some valuable 
programming techniques that can be adapted easily 
to your own programs, and the programs are fun to 
use, besides. Although I realize it is impossible to 
completely convey my own admiration of IRIDIS in 
the length of this review, take it from an old hand; 
IRIDIS is, and promises to be in the future, one of 
the major works ever to be published for the Atari 
800. 




ATARI OWNERS 
FREE 

Of K f CTOR r OF ATARI 

SOFTWARE » HARDWAtte 

SOURCES 



P.O.BOX 64? 
MELVILie N.Y. ir7<)7 



1 oivn : 
A tan" 800 O - 
400 O 



Ofher Q None O 



NAME 



ADDRESS 
CITY 



.ST.. 



IIP. 



J 



Announcing 




software 

from the 

authors of 

An Invitotion to Programming 



exciting games 

and educational programs 

for kids, 

teenagers 

and 

adults 

featuring sound 

and color graphics, 



< 



available on 

guaranteed-to-load 

cassettes 

at fine 

computer dealers in your 

area or, 

write us directly for 

descriptive materials 




Program Design, Inc. 

Department CA 

11 Idar Court 

Greenwicti, CT 06830 

203-661-8799 



80 



COMPUTE! 



February. 1981 Issue 9. 



Review 



Atari IVlusic 
Composer 



Jerry White 

Atari owners with an ear for music will love the 
Atari Music Composer. It is as much fun as it is 
educational. There's something fascinating about 
hearing music and seeing it displayed in music form 
at the same time. After a little experimentation, you 
will find the creative possibilities endless. 

At first you may be awed by the twenty page 
manual. Relax! To get started, you need only read 
thru pages 3 thru 13. Part 1 is a general description 
that explains all your options and commands in 
detail. There is a great deal of data on these six 
pages. Don't try to memorize it, just read thru it. 
Part 2 is a sample session where you actually create 
the song Row, Row, Row Your Boat. It is very well 
written and easy to follow the step by step instruc- 
tions. Once you finish this part, go back and reread 
part 1 . Now it will be easier to digest since you are 
reading it for the second time and have used many of 
the commands. By now about an hour has passed 
and you are ready to enter a song from your human 
memory or copy one from sheet music. Go to pages 
19 & 20 in your manual. Here you will find a Quick 
Guide of all the commands. Use it as reference. 

Allow me to give you some hints that will be 
quite helpful. Remember that a phrase is a section of 
music. There are four voices as in the Atari Basic 
Sound command. However, in the Music Composer, 
they are numbered 1 thru 4 instead of thru 3. 
These voices are preset so that each has a Play com- 
mand. Voice 1 is set to Play Phrase 1, Voice 2 is set 
to Play Phrase 2, and so on. Let's assume you have 
just created a one voice song consisting of two 
phrases. Assume you have Arranged Voice 1 to 
Display, Play Phrase 1, and Play Phrase 2. Now you 
want to Save your song on tape or diskette. Don't 
save it yet. Since Voice 2 was preset to Play Phrase 
2, you will have Voice 1 playing one section of your 
song while Voice 2 is playing the other section. That 
will probably sound terrible since you did not create 
these two phrases as harmony. The thing to do is to 
change each of the preset Voice 2, 3, and 4 com- 
mands to Play Phrase 9. Since you have no phrase 9, 
those Voices will remain silent. 

Sooner or later you will add harmony voices. 
When you do, all voices will have to be syncronized. 
You may want Voice 1 to Play Phrase 1 while Voice 
2 plays phrase 3 and Voice 3 plays phrase 5 and 
Voice 4 plays phrase 7. That may sound difficult to 
you but your Atari computer will understand it. A 



problem may arise when you try to coordinate the 
four voices. For this reason, you should use the 
Check Measures option. This will tell the computer 
to check the length of each measure as it is entered. 
You will be notified if a measure is too long or too 
short. Since the measures arc counted and 
numbered, it shouldn't be difficult to track down a 
problem as long as your measures are correct length. 

When you save your music files on tape or 
diskette, I suggest you use the extension .MUS for 
music files and .HAR for music files including har- 
mony. This will make it easy to tell music files from 
programs. 

For those who do some programming, Part 3 of 
the manual explains the music file structure and sup- 
plies three Basic program listings. Alas, here the 
manual is flawed. The first program is the only one 
documented. It dumps music files onto the screen. It 
works if you leave out line 80. I believe that was 
meant to be a REM statement. As written, the other 
two programs were meant to be used only as 
guidelines to the experienced programmer. 

To those of you who decide to key in the har- 
mony program, you will need a disk system and over 
32K. It will run on a 32K system if you change line 
5 to NN = 180. NN is used to dimension many ar- 
rays. It is the number of notes the program can han- 
dle. You will have to make NN only as large as the 
music file it must read. Therefore it can run on less 
than 32K if it is to create harmony to a short song. 

Enjoy the Atari Music Composer. Good luck 
and good music. @ 



8K BASIC ATARr'^ 'p'nh'ir.l 



MS 



THREE-BASE CALCULATOR - $12.95 

Hexodecimol, Decimal, Octal. Reverse Polish 

AUDIBLE DISASSEMBLER - $9.95 

op-code generales a 'one. Decimol Hexadecimal. 

DECISION MAKER - $8.95 

Aids in evaluoMon of complex decisions, 



1 r 



Color 

Computer 
I Concepts 



ATARI is a frociemark of 
ATARI, INC 

P.O. BOX 1206 
KENT, WA 98031 



FGbruory, 1981. Issue <?. 



COMPUTE! 



16K MEMORY EXPANSION BOARD FOR THE ATARI 80Cr«. .899.95 

Completely compatible with current hardware 
Plugs directly into the computer 
One year warranty 

MICROTEK MT-80 LINE PRINTERS 

1 25 characters per second 

40, 80, 132 characters per line 

9x7 dot matrix 

Parallel interface --- - - S699-95 

Serial interface— - -- - ---- S749.95 

MICROTEK PARALLEL LINE PRINTER INTERFACE FOR ATARI 800™ $64.95 



ANDERSON PERIPHERALS, INC. 

P.O. Box 629 

Richardson. Texas 7508Q 

214-231-6866 



Atari IS a trademark of Atari, Inc. 



COMPUTE needs you! Let us know 
what interesting applications 
you're conning up with for your 
Atari. 



Star Fleet to All 
Cruisers... 



VVht)'s the current chain]} cii" Star Raidcr.s? Send 
in votir best score, cotiintents and playing stratc- 
iries K) COMPUTE, P.O. Box 5406, Greensboro, 
NC 27403. 
Attn: "Atari Ciazctte" 




SOFTWARE 

FOR 

ATARI 



PROGRAMING AIDS 

BASIC RINUMBER Change /ines, references, even variables.'? 
inrludes BCD convorfer and BASIC PRGM. OfCQDffi i'14,95 CsUa 

S 19.95 Disk 

CHALLENGE & FUN 

SPACi CHASE Conquer Ihe galaxy - .it you can escope from 
the deadly chase of Ihe patrol fleet . 4 levels, 

TIME BOMB Race ogoi'nst ihe clock in a mine field; some 
ore recidy (o exploc^J 5 (eve(s-ony number of players and 
score faocjrcJ for top p/nyerst 

MIND'T RAC E II you like Simon you wfli iove this <:hal - 
Jenge... a real test for your memory, 

DOT5-N- BOXfS Yau played it as a kid., it is 
even better on computer 

Each game $ 9.95 2 fori 14.95 4 lor $24.95 csslle 

■■ SI4.95 ■■ S 19.95 ■■ S29.95 disk 

EDUCATIONAL 

MY FIRST ALPHABET Before you send your kfd to school, 
he v/ill knoM all the letters, numbers , mus/cctl funes , 
animais ... even typing and how to ron a program .' .' 
with buiJf-in plus cosfu me grapiiics , J 29, 95 ci fill only 

SEND CHECK OR MONEY ORDER TO : 

SWIFTY SOFTWARE . INC. 

P.O. BOX 641 
MELVIILE N.Y. 1174 7 

K.y. BESIDENIS ABD 
,[nri .1 a itud,.mo.k oF Atoi . Inc 7% SALES TAX 



82 



COMPUTE! 



February, 1981 Issue 9 



Put A Printer 
On The Atari 
Ports 



C Kingston 
White Plains, N.Y. 

In order to use a printer other than the two 40 col- 
umn models that plug directly into the serial port on 
the Atari, the Atari owner must either buy an Inter- 
face Module or find some alternate method of com- 
municating with the printer. A suspicion that a 
method of using the joystick ports for general I/O 
purposes might be found was partially confirmed 
when a commercial cable and program became 
available to drive a printer through joystick ports 3 
and 4. Although getting the commercial cable would 
be the easy (albiet expensive) way to proceed, I felt 
that more could be learned about the Atari by 
designing and building one. After a lot of digging or 
information on the Atari, the pieces fell together and 
resulted in a cable and program for the Atari that 
would run a printer operating out of the joystick 
ports. This article provides the necessary information 
so that the reader can construct a similar cable for a 
printer, or use the joystick ports for general I/O. 

First, a litde information about the Atari joystick 
ports. These use the two eight bit I/O ports of a 6520 
PIA chip. Joystick ports 1 and 2 share one of the 
6520's eight bit ports (Port A), and joystick ports 3 
and 4 share the other 6520 port (Port B - this is the 
one we will use for the printer). Pins 1-4 of the 9-pin 
D connector of joystick port 3 are connected to bits 
0-3 of PIA port B; pins 1-4 of joystick port 4 are con- 
nected to bits 4-7 of the same PIA port. Diagram 1 
shows this arrangement. 

6520 PORT B 



\ji^ '^ f 



mt — tt 



♦. ff. *T 'r ^'O 



\tl i i Jr./ \ri 1 1 1 5. / 



t 



PORT 3 



PORT 4 



DIAGRAM 1 



Port B is addressed by Atari locations $D301 
and $D303. Port A is addressed by locations $D300 
and $D302. Unfortunately, the conrol lines 
associated with these ports are apparently not 



available to the user. With this limitation, the 
joystick ports can easily be used for general I/O pur- 
poses. A 6520 port uses the two registers to control 
the specific function of the port bits. For port B, 
location $D303 is the control register, which we will 
call PCR. Location $D301 is the data or data direc- 
tion register, which we will call DDR. Note that 
DDR has two functions. When it is functioning as a 
data direction register, it allows us to select which 
bits of the data are to be input and which are to be 
output. A in the data direction register selects the 
input mode, while a 1 selects the output mode. 
When it is functioning as a data register, it inputs or 
outputs the appropriate data bits when connected to 
a peripheral device. 

We select DDR as a direction register by setting 
bit 2 of PCR to 0; we select DDR as a data register 
by setting bit 2 of PCR to 1 . So the sequence for set- 
ting Port B up as an output port is as follows: 

1. Put S30 in PCR (Make DDR a direction register) 

2. Put JFF in DDR (Make all bits output) 

3. Put $34 in PCR (Make DDR a data register) 

Note that $30, rather than $00, is used as the base 
byte or PCR. This is to maintain the normal 
operating mode of the Atari, which presumably uses 
the control lines for purposes other than the ports 
(the bits other than bit 2 are used for other control 
purposes). If you wanted to make the port an input 
port, which it is for the joysticks, put $00 in DDR in 
step 2. Specific bits can be made cither input or out- 
put by making the associated direction bit a or 1 
respectively in DDR in step 2. Note that the bits are 
pulled to -I- 5 volts when set for input. Leventhal's 
book (6502 Assembly Language Programming) has 
instructions and several examples on using the 6520 
chip (in Chapter 11), and the reader is referred 
there, or to specification sheets, for further informa- 
tion on the operation of the 6520 PIA. Pin 6 of each 
joystick port is connected to the joystick trigger. The 
trigger or port 4 is read at location $D0I3. Only the 
least significant bit is used, so the value is either 1 
(trigger not pressed-line pulled high) or (trigger 
pressed-line grounded). We will use this for hand- 
shaking. 

The plan of action begins to becoine clear -- or 
docs it? We simply connect Port A to the printer and 
connect the trigger pin to the outgoing Busy line on 
the printer. Then we'll connect the Strobe pulse to, 
uh. There's the rub; we don't have an extra output 
line available in joystick ports 3 or 4. We could bring 
another joystick port into action, but this would be 
wasteful. Well, what about bit 7, which is only used 
for parity or special purposes. If we can get along 
without it, then we can use it for the strobe, and in- 
deed, this is what we'll do. It must be kept in mind 
that special operations of the printer that may use bit 
7 cannot be invoked if we do this. 

Now a direct connection between the Atari and 
the printer would seem to be acceptable. This may 
be the case if twisted pair cable is used and good 



February. 1981, Issue 9. 



COMPUTE! 



83 



grounding practice is followed. I have been using a 
direct connection off of the KIM-1 application port 
to drive a printer for some time (the PIA is not a 
6520 though). But it appears not to be acceptable if 
only two or three ground connections are used, 
which keeps the cable reasonably simple, and the 
printer uses pull-up resistors for the input lines. My 
guess is that the 6520 cannot sink enough current to, 
drop the lines to a respectable level for a 0, thus 
leaving them near the transition voltage. Any 
induced hum or noise can then cause a fluctuation 
between and I on the lines. And induced hum or 
noise can then cause a fluctuation between and 1 
on the lines. And indeed, a direct hookup produced a 
machine gun like output of the same letter as the 
strobe line was apparently bounced up and down by 
60 cycle hum. One answer to this is to use buffer 
chips or transistors to adequately drop the lines for a 
output. Because of their availability, inexpensive 
PNP transistors (2N3906 or 2N5139, etc.) were 
chosen. Diagram 2 illustrates the complete cable. 



PRINTER 




PORT 3 






PORT 4 



□ 



Atari 



Printer 

PNP 

2N3906 
^- etc. 



\ 



DIAGRAM 2 



Note that the connections to the transistors from the 
Atari ports must be as short as possible. The connec- 
tions on the one I built are about one inch long, and 
the transistor board sets on the table under the ports. 
Also note that bit 7 on the printer must be tied to 
ground. The entire cable should not cost more than 
$25, probably much less with careful mail order 
shopping. 

A simple software driver applicable to any 6502 
based computer could be used to drive the printer. 
However, if we want to take advantage of the Atari's 
flexibile I/O system, the program must be written 
specifically for this purpose. The program in this ar- 
ticle was written so that it will hook into the 
operating system (OS) and operate in place of the 
normal OS printer subroutines. It is located at 
$067A-$06FE, which is an area that will presumably 
be left alone by Atari software so that it will remain 
available for users' programs. 

The Atari controls I/O by means of a set of 
routines in the Central I/O Utility (CIO). Almost all 



I/O calls go through the CIO, which is why the 
Atari has such flexibility in its handling of I/O. A 
section of the OS ROM is dedicated to the routines 
which perform the I/O operations. These routines are 
called through I/O Control Blocks (lOCBs), which in 
turn transfer operation to the required routine seg- 
ment (Handler) by using a vector table (Handler 
Vector Table). (There are eight lOCBs, and thus the 
Atari can have eight active I/O devices at any one 
time.) The key to the use of the handlers is the 
Device Table, which is transferred from ROM to 
RAM on system initialization. This table contains an 
identifying letter for each device Jilong with the 
address of its handler vector table. We can therefore 
change the address in the Device Table to point to 
our own handler vector table, which we can set up in 
RAM. The program in this article sets up a printer 
handler vector table at locations $680-$68E, which 
points to the handlers starting at $690. Note that the 
vectors point to the handler routine address minus 
one. The vector table address in the device table for 
the printer (located at $31B-$31C) is changed to 
point to our handler vector table. The lOCB set up 
for the printer therefore directs the program to one of 
our handlers rather than to the Atari OS handlers for 
printer operation. 

One problem is encountered in such an arrange- 
ment: the device table is re-initialized whenever the 




^ 



Software for the Atari! 
SPELLBOOND 



'^ 



An exlrernt?ly verMliltr. user ori- 
ented program lor any QTadt- 
Icvf-l Can be u^ed wilt^ tMSting 
d<Jtd base, uscf crcalt-d ddla. or 
dddidonal data caSbcHus 

U f*.'aLures: 
\ Lt-'drning level - holds a word 
on the screen for you to study- 
• Test k'vei - flashes Ihe word on 

thf scfL-en for you to sfH.'ll 
I Comes with a djia base o1 thi"^ \ 
tiiosl fifquently misspelled j 
words 
CftiJte your o<A'n data bdse. 
Store the words on cassette for / 



• Chatuje Ihe words in tht- data 
bJse with one ol Ific additiondl 
Cfissetles ^hat are available, 

SPELLBOOMD DATATAPESfol 
lo* a phonetic sequence. Tape 
" 1 begins wi!h lihort vowel, three i 
letter words and progresses to i 
loiKj vowel lour Setter words The 
words on each cassette continue 
thrb bL-quence, AM words in this ' 
series are grouped phonetically 1 
and by (jrade level whenever po^ 1 
sible. All DATA cassettes contain 
300 words 



SPELLBOUMD 515,00 

{mj.stt.'f [Ko^ram with mof^t 
Irequentl^ tt^i^^ fuelled words) 
BASIC ^4n 
SB DATA TAPE'! ^5 0U 

(short vowels long vowels) 
SB DATA TAPE »2 55 00 

(short vowels/long vowels 
/blendsJ 
SB DATA TAPE '3 . . ^5,00 
Grades? 4 (lili-nds hards 
soft I I 

SB DATA TAPE '4. . . . 55.00 
Grades 24 (diplhongs 
homonyms) 
SB DATA TAPE *5 . , . S5.00 
(silent letters endings 
compound wordsl 
SB DATA TAPE *6 5300 

Grades 3 5 (more diplhong^ 
double con-iorianli.) 
SB DATA TAPE '7. , . 55,00 
Grades4-6 (compound words 
endings) 
SB DATA TAPE '8. , 55.00 
Grades 4-6 (words iiol rnveri;d 
in prfvious units) 
Ail Data lapes Reguitr 
The Spellbound Master Program 




PL), Bt« 117 ,. 

Garden City. W^S'^^ 

°-^^; 595 4722 lor COD. 

Dealer Li^q>.J"" 



Write F«,F^Pj^^^; 



■■"ildli »dl),l^^■T■> 



84 



COMPUTE! 



February, 1981 Issue 9 



system reset button is pushed. Unless we can put our 
handler vector table address back into the device 
table at that time, we would have to do a separate 
re-initialization step. Fortunately the OS system reset 
sequence uses certain page zero vector locations for 
initialization purposes. One is for cassette operation 
initialization (CASINI at $0O02-$OOO3), and one is 
for disk operation (DOSINI at $0OOC-$OOOD). 
Depending upon which we are using (disk or 
cassette) we can set this vector to point to a short 
routine that re-establishes our handler vector table 
address. By also transferring the original content of 
the page zero initialization vector, we can then send 
the program off to do whatever it was originally 
supposed to do so that everything will operate pro- 
perly. The following brief description of the opera- 
tion of the parallel printer handler shows how these 
facts are incorporated into the program. 

The six bytes at $067A-5067F control the 
driver's hookup to the OS after a system reset. The 
bytes labeled LO and HI are used to store the 
initialization entry location (for the program - or 
cartridge - that will use the printer driver), which is 
read from $OOOC-$O00D (DOSINI) during initializa- 
tion. The segment in $0680-$068E is the handler vec- 
tor table that points to the appropriate subroutine in 
the driver (address-1). The byte of $068F is used as a 
counter for the line length. The subroutine 'OPEN' 
sets up the 6520 PIA port B as an output port. The 
subroutine 'WRITE' is the actual printer driver. 
The byte at S06D2 determines the line length, and is 
set to the desired number of characters per line plus 
one. As written, the program is set for a line length 
of 78; the byte is set to 79 ($4F). It can be set for 
any line length up to 254. 

The printer driver looks for the Atari code for 
RETURN, which is $93, and converts it to the 
ASCII code of |0D. This is the only ATASCII 
(Atari ASCII) code that is decoded by the driver. 
The ATASCII and ASCII codes for letters, 
numbers, and most punctuation and symbols are the 
same, and other conversions do not seem necessary. 
The driver assumes that the strobe is high to low. If 
your printer strobes from low to high, change the 
following: 

06B9 AO 00 0033 LDY #S00 

06BB 29 FF 0034 AND #$7F 

06CO 09 80 0036 ORA #$80 

If your printer automatically outputs a line feed after 

a carriage return, change $05D7 from $0A to $00. 

The segment at BINIT is the initialization 
subroutine. This sets $OOOC-$0O0D (DOSINI) to 
point to the handler setup subroutine, and puts the 
original content of DOSINI in LO-HI. If you are 
not using DOS, then change $06E3 and $06EF from 
$0C to $02, and $06E8 and $06F3 from $0D to $03. 
This sets the program up for cassette operation and 
initialization. If you are using the driver with 
BASIC, you can initialize it by using the USR in- 
struction pointing to BINIT (1761 decimal). This 



supplies the necessary FLA command for the USR 
instruction. If you initialize it from a machine 
language program, do a JSR to INIT (|06E2). If 
you are using a disk to load the printer routines, wah 
until the disk drive shuts off before initializing the 
driver. For some reason that I have not tracked 
down, initializing the driver while the disk drive is 
running seems to inhibit it from turning off. There is 
no problem here once the printer driver initialization 
is complete. 

The segment HANFX is the one that re- 
establishes contact with the OS. This is run during 
initialization, and is called after a system reset. The 
only way to remove the driver from operation is to 
turn the computer off or change DOSINI ($000C-D), 
or CASINI ($0002-3) for cassette operation, back to 
the values in LO-HI. 

Once initialized, the driver will operate with all 
BASIC commands that drive the regular printer 
routines. It will also work with all machine language 
programs that use the I/O control block.s to drive the 
printer routines. You may have to clear the printer 
and return the carriage to the left by outputting a 
RETURN (using the command 'LPRINT' in 
BASIC) after initiiilization. This will depend upon 
the particular printer that you are using. If you write 
a machine language program that outputs to a 
printer, it will interface to cither the Atari OS 
handlers or the one here if you go through the 
lOCBs. However, using the lOCBs requires a bit of 
programming to set up the proper parameters. It is 
simpler to directly use the driver routines without go- 
ing through the CIO. This seems to be what is 
generally done on most other microcomputers. In 
that case however, the program will not operate a 
printer connected to the serial port. 

To use the parallel handler directly in a machine 
language program, the handler program must be 
loaded into $67A-$6FE. Then it must be initialized 
by a JSR INIT, This locks it into the system. Before 
using the printer, the port must be initialized by a 
JSR OPEN. Then each character to be printed is 
placed in the accumulator (A) followed by a JSR 
WRITE. At the completion of the printed material, 
do a JSR CLOSE (this only puts out a CR, and may 
not be necessary depending upon the printer used 
and the program). A skeleton program would look 
like this: 

START JSR INIT 

JSR OPEN 
MAIN . , . 

LDA CHAR 
JSR WRITE 

END JSR CLOSE 

JMP EXIT 
You must be careful in assuming that a machine 
language program that supports printer output uses 
the I/O Control Blocks (lOCB's). For instance, the 
driver was written using the assembler for the Atari 



FebruofY. 1981 Issue 9. 



COMPUTE! 



85 



by Quality Software. This program does support 
printer output, but it does not use the lOCB's com- 
pletely. The actual output that sends the character 
for printing calls the Atari WRITE handler directly. 
The calling address must be changed in such a case 
to point to the WRITE handler in this program. 

There is no reason that the joystick ports cannot 
be used as pseudo RS-232 ports as well, and thus for 
printers or other peripherals that require serial I/O. I 
expect to be writing a program for this in the near 
future in order to connect a digital input pad. One 
problem in the Atari for this may be the use of inter- 
rupt processing subroutines by the OS; these may 
throw off any timing loops used for serial control. 
This might force one to inhibit the interrupts, or to 
use the timers in the Atari for liming control. Who 
knows, maybe the Interface Module isn't really 
necessary for flexible I/O with the Atari. 







00vi2 




CON 








0003 




ORG 


$674 






0004 


* f'RINTER 


ORI VER 






0005 


c. 


KINGSTON (1980) 


0674 20 F4 


06 


0006 


REENT 


JSR 


H4NFX 


0670 AC 




0007 




HEX 


4C 






0008 


LO 


OS 


1 






0009 


HI 


DS 


1 


0680 8F 06 


48 










f;6 DE 


06 


0010 


H4tiiT4RHEX 


8F06A306DE06 


0686 68 06 


DE 










06 DE 


06 


0011 




HEX 


4806DE06DE06 


063C 4C 78 


EE 


0012 




HEX 


4C7BEE 






0013 


CTK 


DS 


1 


0690 i9 3« 




0014 


OHFN 


LD4 


«S30 


0692 BD 03 


03 


0015 




SIA 


$0303 


0695 i9 FF 




0016 




LD4 


#$FF 


0697 8D 01 


D3 


0017 




ST4 


SO301 


069a i9 34 




0018 




LOA 


*$34 


069C 8D P>3 


03 


0019 




STA 


$D303 


069F 49 80 




0020 




LOA 


*$S0 


06fi1 8D 01 


D3 


0021 




STA 


$D301 


0644 40 01 




0022 


4LCL0 


LOY 


*$01 


0646 60 




0023 




RTS 




0647 49 0D 




0024 


CLOSE 


LD4 


#$00 


0649 C9 9B 




0025 


W\ IE 


CMP 


*$9B 


06AB D0 02 




0026 




RNE 


RRT 


06flD 49 0D 




0027 




L04 


#$0D 


06flF 42 04 




0028 


PRT 


LDX 


#$0 4 


06H1 4C 13 


D0 


0029 


RSY 


LDY 


$D013 


06B4 D0 F9 




0030 




BNE 


PRT 


06H6 C4 




0031 




DEX 




06H7 D0 FS 




0032 




HNE 


BSY 


06fa9 40 80 




0033 




LDY 


*f80 


06HB 09 80 




0034 




0R4 


*$80 


06HD 8D 01 


D3 


0035 




STA 


$D301 


P6C0 29 7F 




0036 




AND 


n7F 


0feC2 80 01 


03 


0037 




STA 


$D301 


06C5 3C 01 


03 


0038 




STY 


$D301 


06C8 C9 00 




0039 




C^^F-' 


#$0D 


06C4 D0 0E 




0040 




Rf^JF 


TEST 


06CC 42 80 




004 1 


DEL4Y 


LDX 


#J80 


06CE C4 




0042 


DEL 


OEX 




06CF D0 FD 




0043 




hNE 


DEL 


06D1 49 4F 




0044 




LD4 


*$4F 


06 D3 8D 8F 


06 


0045 




STA 


CTR 


06D6 49 04 




0046 




LD4 


#$04 



0606 
06DA 
0600 
06DF 
06E1 
06E2 
0fcF4 
06E7 
06E9 
06EC 
06FE 
e5F0 
06F2 
06F4 

06F6 
06F9 
06FH 
06FE 



00 
CE 
F0 
D0 
65 
A5 
BD 
45 
80 
49 
85 
A9 
85 
49 

80 
A 9 
80 
60 



05 
BF 
C8 
C3 

0C 
7E 
00 
7F 
7A 
0C 
06 
00 
80 
IB 
06 
1C 



06 



06 



06 



03 



SYMBOL TABLE 
REENT 067A 
HANT4b0680 
ALCLO 06A4 
PRT 06AF 

DEL eecE 

bINl T 06E1 



0047 

0048 

0049 

0050 

0051 

0052 

0053 

0054 

0055 

0056 

0057 

0058 

0059 

0060 

0061 

0062 

0063 

0064 



LO 

CTR 

CLOSE 

BSY 

TEST 

IN IT 



TEST 



BACK 
BINl T 

INIT 



HANFX 



BNE 
DEC 
BEO 
BNE 
PL4 
L 04 
STA 
LDA 
STA 
LOA 
STA 
LDA 
STA 
LDA 
STA 
LDA 
STA 
RTS 



PRT 
CTR 
CLOSE 
ALCLO 

$0C 

LO 

$00 

HI 

«REENT 

$0C 

#>REENT 

$00 

#$80 

t031B 

*$36 

$03iC 



067E 

068F 
06A7 
e6B1 
06DA 
06E2 



HI 

OPEN 

WRITE 

DELAY 

BACK 

HANFX 



067F 

0690 
06A9 
06CC 
06OF 
06F4 



teo 



vS 



Atari 
Owners 

who need support 



Send for your FREE Mosaic Electronics 
software catalog today. Includes games, 
educational programs, utilities and more. 



I have an Atari 400- 



, Atari 800- 



Please send me your: 

D BK to 16K RAM expansion kit (S79.00) 

|My check is enclosed) 
D Software Catalog 



ciTy_ 



Send to: 



k^lVtOSAIC 



ELECTRONICS 
P.O. Box 748 (CC) Oregon City, Oregon 97045 

Mos3!C f^lECtfOmcs is in no w^y gtiitutwd ^tth Atari 



86 



COMPOTE! 



February. 1981, Issue 9. 




Double-Density 

Graphing 

OnTheO.S.i.C1P 

When analyzing data or trying to understand an 
algebraic equation, a quick X,Y plot is often an in- 
valuable first step. The O.S.I. ClP, despite its ex- 
tensive graphics character set, doesn't particularly 
lend itself to graphing because of its cramped 24 x 24 
video format. 

One way to ease the crowding and double the 
resolution of a plot is to make use of graphics sym- 
bols that divide each square into quarters. I've writ- 
ten a program in BASIC that does this quickly and 
neatly (Fig. I). As written h can stand by itself or, 
with slight modifications, function as a subroutine 
called up by a number-crunching main program. 
The effective display is increased to 40 x 40 bringing 
it into the range of usefulness for many scientific and 
business applications. 

The program is designed first to scale the input 
data array, DA(I), between and 40 (lines 5260 
-5332) and put the results into array DY(I). Datasets 
with a difference between maximum and minimum 
values of more than 40 are condensed and smaller 
ones expanded on the graph. Both positive and 
negative values now will be plotted above the X-axis. 
Actual high (YH) and low (YL) values are saved and 
printed by line 5900 to give an idea of absolute as 
well as relative magnitudes. Next, 40 locations on the 
video display are computed for the scaled points. 
This must be done two points at a time because 
several symbols can be used to represent the pair, 
depending on whether they are equal, different by ± 
1, or neither. Lines 5340 - 5780 code for the selection 
of the correct symbols. Figure 2 shows a decision tree 
that depicts how the choice is made. Since the first 
point of the pair automatically has an odd X-value 
(1,3, 5,... 39) and the second an even value 
(2, 4, 6, ...40), only Y-values need be evaluated as odd 
or even. Based on the following table of possible X,Y 
coordinates, the correct quadrants are chosen for 
each square: 



Gary Boden, 
Norrogorrsett, Rl 

Line 5800 computes the video display locations 
rounded to the nearest integer. 

The axes are drawn by lines 5210 - 5252. I also 
include a background grid (lines 5100 - 5130) to help 
read the plotted curve, but this may be deleted easily 
if not needed. The purpose of lines 6000 - 6030 is to 
check for a "return" that when found causes a 
recycling to the start. 

None of this would be any good without a curve 
to plot. Line 210 is where the u.ser enters his equa- 
tion (or READ statement for data input) before run- 
ning the program. DA(I), the data array, remains 
unaltered in case it is needed elsewhere. Any number 
of variables supplied by the user and/or program 
may be used so long as they arc assigned before line 
210. Figure 3 shows a graph of DA(I) = 
SIN(I/X)-COS(I/Y) where X = 3, Y = 6.3, and I 
goes from 1 to 40. Note that the scaled value of the 
34th point is zero and that a blank spot is placed on 
the X-axis under the previous point. 

The program occupies about 1700 bytes of 
RAM, but by dropping all the extras — remarks, 
header, instructions, etc. - it can fit into about 1 K 
of memory. Running time is around 8 seconds, 
much of it spent scaling and drawing the 
background; the curve plots out rapidly. 

Four extensions of this routine come to mind 
which you may want to make to adapt it for your 
own purposes; 

1 . adjust axes to show negative plot quadrants 

2. overplot more than one curve on the same 
graph 

3. extend the X-axis with a second plot 
showing points 41-80 

4. fill in below the curve to make a bar chart 
In conclusion, this routine takes a big step 

toward relieving the ClP's small display problems 
when graphing. It is compact and quick, leaving 
plenty of memory to use for other things. 



QUADRANT 


STATUS 


EXAMPLE 


LEFT BOTTOM = 


X ODD, Y ODD 


(14) 


LEFT TOP = 


X ODD, Y EVEN 


(1.2) 


RIGHT BOTTOM = 


X EVEN, Y ODD 


(Z.l) 


RIGHT TOP = 


X EVEN, Y EVEN 


(2,2) 



Februaiy. 1981 Issue 9. 



COMPUTE! 



87 



KKAD POINT A 



GRAPHICS SYMBOL ,,|, 

AND.VLMHKK 



IS POINT H? 



GRAPHICS SVMBOI. 
AND NUMBER 




Fig. 2. Decision tree for selecting correct graphics 
symbols. 







Figure 3. 

Doublc-dfiisily Plot On The 

O.S.I. CIP. 



10 REM— DOUBLE 
20 REM — BY G. 
30 REM — ENTER 
40 REM — THE Y 

FROM 
50 REM — AND 40 

Y-AXIS 
60 F0RI=1T025: 
65 PRINT"***** 
70 PRINT"DOUBL 
72 PRINT"ON TH 
74 PRINT"***** 
: PRINT 



DENSITY GRAPHING ON THE CIP 
BODEN; 9 DEC 1980 
YOUR EQUATION ON LINE 210 
AXIS IS AUTOMATICALLY SCALED 

TO 40 

POINTS ARE PLOTTED ON THE 

PRINT:NEXT 

E-DENSITY PLOTTING" 
E O.S.I. CHALLENGER" 
*******************" . PRINT 



80 PRINT"HIT 'RETURN' AFTER PLOT TO RECYCLE 
TO BEGINNING" :PRINT:PRINT 

100 DIMDA(50) :DIMDX{50} :DIMDY(50) 

120 INPUT"ENTER X";X 

130 INPUT"ENTER Y";Y 

200 FORI=1TO40 

210 DA(I)=SIN{I/X)-C0S(I/Y) 

220 NEXT 

4900 REM — DRAW THE GRAPH AXES AND REFERENCE 

POINTS 

5000 F0RI=1T025: PRINT: NEXT 

5100 G2=53446:FORJ=1TO20 

5120 FORI=1TO20 

5125 POKEG2+I,207:NEXTI 

5130 G2=G2+32:NEXTJ 

5210 FORG=53446TO54054STEP32 

5220 POKEG,157:NEXT 

5230 G=54086:FORI=1TO20 

5240 POKEG+1, 155: NEXT 

5250 POKEG,166 

5252 T=177 :P0KEG+5 ,T: POKEG+10 , T:P0KEG+15 , T 

5255 REM — SCALE THE DATA 

5260 YH=DA(1) :yL=YH 

5270 FORI=1TO40 

5280 IFDA(I)>YH THENYH=DA(I) 

5290 IFDA(I)<YL THENYL=DA(I) 

5292 NEXT 

5300 YR=YH-YL 

5305 NF=0:IFYL<0 THENNF=ABS ( (YL/YR) *40) 

5310 FORI=1TO40 

5320 DX{I)=I 

5330 DY{I)=INT{ (DA(I)/YR) *40+NF+.5) 

5332 NEXT 

5335 REM~PLOT OF CURVE 

5340 1=1 

5500 IFINT(DX(I)/2)*2>=DX(I) GOTO5670 

5510 IFINT(DY(I)/2)*2=DY(I) GOTO5600 

5520 IFDY(I) <>DY(I+1) GOTO5550 

5530 SY=154:GOSUB5800 

5540 GOTO5750 

5550 IFDY(I)<>DY{I+1)-1 GOTO5580 

5560 SY=170:GOSUB5800 

5570 GOTO5750 

5580 SY=167:GOSUB5800 

5590 GOTO5670 

5600 IFDY(I)<>DY{I+1) GOTO5630 

5610 SY=155;GOSUB5800 

5620 GOTO5750 

5630 IFDY(I)<>DY{I+1) GOTO5660 

5640 SY=169:GOSUB5800 

5650 GOTO5750 

5660 SY=168:GOSUB5800 

5670 DY(I)=DY(I+1) 

5680 IFlNT(DY(I)/2) *2=DY{I) GOTO5710 

5690 SY=165:GOSUB5800 

5700 GOTO5750 

5710 sy=166:GOSUB5800 

5750 IFINT(DX(I)/2) *2>=DX(I) GOTO5770 

5760 1=1+1 

5770 I=I+1:IFI>40 GOTO5900 

5780 GOTO5500 

5800 POKEG+INT((DX{I)/2)+.5)-32* 
INT{ (DY{I)/2)+.5) ,SY: RETURN 

5900 GOSUB6000 

5910 PRINT"HI="YH;"LO="YL 

5920 GOSUB6000 

5930 GOTO120 

5990 REM — LOOK 

6000 POKE530,1; 

6010 POKEK,223i 

6020 GOTO6010 

6030 POKE530,0: 

6040 END 



FOR <CR> 

K=57088 

IFPEEK (K) =247THEN6030 

RETURN 



88 



COMPUTE! 



February, 1981, Issue 9, 



A Small 
Operating 
System: 
OS65D 
The Kemel 



Part 2 of 3 

Tom R, Berger 
School of Moth 
University of Minnesofa 
Minneapolis, MN 

Subroutine Descriptions 

Table 3 is a short memory map of the kernel. In this 
section we examine some of the subroutines in the 
map in more detail because they are either useful or 
interesting. The operating system input/output sec- 
tion will be discussed in some detail in another arti- 
cle, however, three subroutine addresses are vital for 
understanding the kernel subroutines. These are 
listed below. 

$2339 Input a character without echo to output. 

$2340 Input a character with echo to output. 

$2343 Output a character. 

Input and output for these subroutines is set by the 

I/O command. 

Most programs are greatly enhanced if they can: 
(1) give instructions or state questions for users; (2) 
receive replies or input from users; and (3) convert 
ASCII hex input to binary and vice versa. The 
kernel contains subroutines to perform these func- 
tions. Below are some of the useful routines in the 
kernel. 

Carriage return, line feed ($2D6A) 
This routine sends a carriage return followed by a 
line feed to the output ($2343). It preserves the 
X-and Y- registers and uses no Z-page locations. 
Output a string of embedded text ($2D73) 
Assume we have the code listed below. 
XXOO 20732D JSR $2D73 
XX03 484921 HI! 
XX06 00 

XX07 A200 LDX #$00 

Suppose this segment of code is embedded in our 
machine language program and the computer is ex- 
ecuting instructions just prior to address $XXOO. 



When SXXOO is encountered, the computer jumps to 
the kernel subroutine at $2D73. This subroutine 
treats every byte from $XX03 onward as ASCII text 
to be sent as output ($2343) until the next $00 is en- 
countered. The code above sends the message 'HI!'. 
Once output is stopped with a $00 (in this case at ad- 
dress $XX06), control is returned to the main pro- 
gram at the next address (in this case $XX07) where 
execution continues. 

Both the Y-register and the Accumulator are 
destroyed by this routine, but the X-rcgister remains 
mtact. Z-page locations $E3 and $E4 point to the ad- 
dress (low byte-high byte) before the beginning of the 
embedded text ($XX02 in the example above). Thus, 
up to 254 characters may be sent out by this routine. 
More characters may be sent by repeatedly calling 
the subroutine. 

Line buffer input ($2C98) 

The buffer is in $2E1E to $2E2F. The subroutine 
begins with a carriage return ($0D) and line feed 
($0A). Further, a carriage return terminates input 
and is stored in the buffer. Therefore, the user may 
input up to 17 additional characters in the buffer, 
Backarrow ($5F) is the standard erase character used 
by OSI so that from the polled keyboard (shift- 
locked) Shift-O erases a character. If you disassemble 
this subroutine you will see a clever use of the 
routine $2D73. It is used to output backspaces and 
spaces in order to erase characters on output. Input 
is obtained via the subroutine $2340 and subroutine 
$2D6A is called to send out a carriage return 
followed by a line feed. 

This program destroys all registers, It uses only 
Z-page locations via $2D73. At $2C9B it resets the 
line buffer output terminator at $2CED, 
Line buffer output ($2CE4) 

Each time this routine is called, it returns the next 
character in the line buffer in the Accumulator. The 
line buffer pointer ($2CE5) is the operand of an 

LDY #NN instruction at $2CE4. Locations $E1 and 
$E2 in Z-page point to the beginning of the line 
buffer and the Y-register is used to index the buffer. 
After the seventeenth character the buffer will return 
a carriage return in the Accumulator, The subroutine 
leaves only the X-register intact. 
ASCII hex to binary nibble ($2D3D,$2D40) 
If entered at $2D3D, this routine will read the next 
buffer character ($2GE4), or you may enter the sub- 
routine at $2D40 with an ASCII hex digit in the 
Accumulator. It will return with a binary number 
(0-15) in the first four bits of the Accumulator and 
O's in the upper four bits. If entered at $2D40, it uses 
no Z-page locations and leaves the X- and Y-registers 
intact, provided there is no error. If something other 
than an ASCII hex digit is read, subroutine $2CA4 is 
called to output an error Number 7 (Syntax Error). 
Further, return will occur to the controlling software 
system via the link set in the jump at $2A4E. 



SOFTWARE FOR OSI 




A JOURNAL FOR OSI USERS!! 

The Aardvark Journal is a bimonthly tutorial for OSI 
users. It features programs customized for OSI and 
has run articles like these: 

1) Using String Variables. 

2) Highspeed Basic On An OSI. 

3) Hooking a Cheap Printer To An OSI. 

4) An OSI Disk Primer. 

5) A Word Processor For Disk Or Tape Machines. 

6) Moving The Disk Directory Off Track 12. 

Four back issues already available! 
$9.00 per year (6 issues) 



ADVENTURES 

Adventures are interactive fantasies where you give the 
computer plain English commands (i.e. take the sword, 
look at the control panel.) as you explore alien cities, 
space ships, ancient pyramids and sunken subs. Average 
playing time is 30 to 40 hours in several sessions. 
There is literally nothing else like them - except 
being there yourself. We have six adventures available. 
ESCAPE FROM MARS - Explore an ancient 
Martian city while you prepare for your escape. 
NUCLEAR SUBMARINE - Fast moving 
excitement at the bottom of the sea. 
PYRAMID - Our most advanced and most 
challenging adventure. Takes place in our 
own special ancient pyramid. 
VAMPIRE CASTLE -- A day in old Drac's 
castle. But it's getting dark outside. 
DEATH SHIP - It's a cruise ship - but it ain't 
the Love Boat and survival is far from certain. 
TREK ADVENTURE - Takes place on a 
familiar starship. Almost as 
good as being there. 

$14.95 each 



NEW SUPPORT ROMS FOR BASIC 
IN ROM MACHINES 

CIS - for the CIP onlv, this ROM adds full 
screen odit functions (insert, delete, change 
characters in a basic line.). Software selectable 
scroll windows, two instant screen clears (scroll 
window only and full screen.), software choice of 
OSI or standard keyboard format, Bell support, 
600 Baud cassette support, and a few other 
features. It plugs in in place of the OSI ROM. 
NOTE : this ROM also supports video conversions 
for 24, 32, 48, or 64 characters per line. Ali that 
and it sells for o measly $39.95. 
C1E/C2E for C1/C2/C4/C8 Basic in ROM ma- 
chines. 

This ROM adds full screen editing, software 
selectable scroll windows, keyboard correction 
(software selectable), and contains an extetided 
machine code monitor. It has breakpoint utilities, 
machine code load and save, block memory move 
and hex dump utilities. A must for the machine 
code programmer replaces OSI support ROM. 
Specify system S59.95 



DISK UTILITIES 

SUPER COPY - Single Disk Copier 
This copy program makes multiple copies, 
copies track 2ero, and copies all the tracks 
that your memory can hold at one time — 
up to 12 tracks at a pass. It's almost as fast 
as dual disk copying. - S15.95 
MAXIPROSS (WORD PROCESSOR) - 65D 
polled keyboard only - has global and line edit, 
right and left margin justification, imbedded 
margin commands, choice of single, double or 
triple spacing, file access capabilities and all the 
features of a major word processor — and it's 
only S39.95. 



P.C. BOARDS 

MEIWORV BOARDS!! - for the CIP. - and they 
contain parallel ports! 

Aardvarks new memory board supports 3K 
of 2114's and has provision for a PIA to give a 
parallel ports! It selis as a bare board for $29,95. 
When assembled, the board plugs into the expan- 
sion connector on the 600 board. Available now! 

PROM BURNER FOR THE CIP - Burns single 
supply 2716's. Bare Ixiard - S24.95. 
IVIOTHER BOARD - Expand your expansion 
connector from one to five connectors or use it 
to adapt our CIP boards to your C4/8P. -$14.95. 



ARCADE AND VIDEO GAMES 

ALIEN INVADERS with machine code moves - 
for fast action, This is our best invaders yet. The 
disk version is so fast that we had to add select- 
able speeds to make it playable. 
Tape -$10,95- Disk -$12.95 

TIME TREK (SKI - real time Startrek action. 
See your torpedoes move across the screen! Real 
graphics - no more scrolling displays. S9.95 

STARFIGHTER - a real time space war where 
you face cruisers, battleships and fighters using a 
variety of weapons. Your screen contains work- 
ing instrumentation and a real time display of the 
alien ships. S6.95 in black and white ■ S7.95 in 
color and sound. 

MilVJOS - A game with amazing 3D graphics. 
You see a ma?e from the top, the screen blanks, 
and then you are in the maze at ground level, 
finding your way through on foot. Realistic 
enough to cause claustrophobia. — S12.95 



SCREEN EDITORS 



These programs all allow the editing of basic 
lines. All assume that you are using the standard 
OSI video display and polled keyboard. 
CIP CURSOR CONTROL - A program that uses 
no RAM normally available to the system. (We 
hid it in unused space on page 2). It provides 
real backspace, insert, delete and replace func- 
tions and an optional instant screen clear. 
S1 1.95 

C2/4 CURSOR. This one uses 366 BYTES of 
RAM to provide a fuil screen editor. Edit and 
change lines on any part of the screen. (Basic in 
ROM systems only.) 

FOR DISK SYSTEIMS - I65D, polled key- 
board and standard video only.) 
SUPERDISK, Contains a basic text editor with 
functions similar to the above programs and also 
contains a renumberer, variable table maker, 
search and new BEXEC* programs. The BEXEC* 
provides a directory, create, delete, and change 
utilities on one track and is worth having by 
itself. - $24.95 on 5" disk - $26.95 on 8". 



AARDVARK IS NOW AN OSI DEALER! 

Now you can buy from people who can support 
your machine. 

-THIS MONTH'S SPECIALS- 
Superboard II $279 

CIP Model II 429 

C4P 749 

. . . and we'il include a free Text Editor Tape 
with each machine! 

Video Modification Plans and P.C. Boards 
for CIP as low as $4,95 




This is only a partial listing of what we have to offer. We now offer over 100 programs, data sheets, ROMS, and boards 
for OSI systems. Our SI. 00 catalog lists it all and conlainsfree program listings and programmlna hints to boot. 

Aardvark Techriical Services • 1690 Bolton • Walled Lake, Ml 48088 

(313)699-3110 or (313)624-6316 




90 



COMPUTE! 



Febfuatv. 1981 issue 9 



A much more useful routine which does the 
same thing occurs in the ROM machine monitor at 
$FE93. This latter routine is entered with the hex 
digit in the Accumulator. It returns with the same 
data as before except in the case of an error, where 
$80 is returned in the Accumulator. The ROM 
subroutine leaves the X- and Y-registers unchanged 
and uses no Z-page locations. 

Full byte binary buffer read (S2D2E) 

This routine reads two hex digits from the line buffer 

and returns with a binary byte in the Accumulator. 

It calls $2D3D and therefore, has the error procedure 

of that routine. It uses $E0 as a temporary storage 

location and affects other registers via subroutine 

$2CE4. 

Full binary address read ($2D23) 
By calling $2D2E twice, this subroutine reads four 
hex digits from the line buffer and stores them as a 
two byte binary address in Z-page locations $FE and 
$FF {low byte-high byte). 
Nibble to hex digit ($2D9B) 

This subroutine converts the first four bits in the Ac- 
cumulator into an ASCII hex digit and outputs this 
digit via S2343. It returns with the hex digit in the 
Accumulator, uses no Z-page addresses, and leaves 
the X- and Y-registers the same. 
One byte binary to two hex digits ($2D92) 
By calling $2D9B twice, this routine outputs via 
$2343 the contents of one full byte binary (in the Ac- 
cumulator) as an ASCII hex two digit number. It 
preserves the X- and Y-registers and uses no Z-page 
locations. The Accumulator is destroyed. 
Error output ($2AC4) 

If called, this subroutine will reset the 10 flags to the 
default value, it will disengage the disk head, and it 
will output "Error # N" where N is a hex digit 
equal to the first four bits in the Accumulator. 
Presumably, since an error has occurred, it does not 
matter which registers have changed. 
Stack and Z-page swapper ($2CF7) 
This subroutine swaps locations $0000-$01FF 
(Z-page and the stack) for locations $2F79-$3278 
respectively. It returns with the Accumulator and 
Y-register changed and the X-register equal to 0. 
When BASIC is resident, OS65D keeps a Z-page and 
stack separate from BASIC. When the Extended 
Monitor and Assembler are resident, OSb5D and the 

Extended Monitor keep a Z-page and stack separate 
from the Assembler. 

Shall we swap? ($2D50) 

If the contents of $00 are zero the swapper is called, 
otherwise this subroutine returns with the contents of 
$00 in the Accumulator and no other changes. 
BASIC and the Assembler keep nonzero values in 
$00 while OS65D and the Extended Monitor keep 
in $00. Thus software can recognize whether or not 
to swap Z-page and the stack. 



Symbol checker ($2D58, $2D5B, $2D5E) 

This subroutine reads the buffer to see if the next 
character is ' = ' ($2D58), ',' ($2D5B), or 7' 
($2D5E). If an error occurs the routine behaves as 
(S2D3D) does, returning to system software con- 
trol after error Number 7 (Syntax Error). It calls 
subroutine S2CE4 and uses Z-page location $E0 for 
temporary storage. This routine uses a standard pro- 
gramming trick of masking 2-byte OPcodes by using 
a 3-byte BIT instruction. 

This concludes a description of the more useful 
subroutines in the kernel. Most routines are not dif- 
ficult to decipher. A few have mildly complex flow. 
The three most involved are: $2A84, The command 
processor; $2C9B, The line buffer input; and $2DA6, 
The DIRECTORY search. These subroutines are 
described via flowcharts in Figures 2 to 4, These 
flowcharts should make it possible to understand 
disassemblies of the corresponding subroutines. 

TABLE 3 

MAP - OS65D KERNEL 

2A4B 

Output an OS65D error # then return to 
linked software (link is via a jump at 2A4E). 
2A51 

OS65D Start-up address. 
2A7D 

Set up the return to software address at 
2A4E. Set to 20D7 at 20D1 in BA. Set to 
1532 at 152C in ASM. Set to 1756 at 1F31 in 
in EM. Set to 2A51 at 2A54 in OS65D. 
2A84 

OS65D Command Processor: called by 
2A51. Commands in a table at 2E30 • 
2E77. 
2AC0 

Output ERR# 7: 'SYNTAX ERROR IN 
COMMAND LINE.' 
2AC4 

Error message. Enter with error # in 
accumulator. Resets I/O flags. Disengages 
disk head. 
2ADE 

Command AS. Load Tracks 5, 6, and 7, 
then run the Assembler. Jumps to start 
at 1300. 
2AE6 

Command BA. Load Tracks 2, 3, and 4, 
then run BASIC. Jumps to start at 20E4. 
2AEE 

Load from the disk the track numbers 
requested by a command routine starting at 
0200 and continuing for 3 tracks. 
2B11 

Command CA. Call a track and sector from 
the disk to memory. 
2B1A 

Engage head, read a sector to memory, 
then disengage the head. 



February. 1961, Issue 9 



COMPUTE! 



2B23 

Command D9. Disable error #9 in the disk 

routines. This routine is not called in 

my version of OS65D. It may be called by 

changing the address in the COMMAND 

DIRJECTORY. 
2B29 

Command DI. Give a sector map of a track. 
2B2r 

Command EM. Load Tracks 5, 6, and 7, 

then run Extended Monitor. Jumps to start 

at 1700. 
2B37 

Command EX. Load an entire disk track to 

memory for examination. 
2B46 

Command GO. Start a machine program at 

specified address. 
2B55 

Command IN. Initialize a track or the 

whole disk. 
2B68 

Text: 'ARE YOU SURE?' 
2B83 

Command lO. Change the I/O flags. 
2BA7 

Command LO. Load a named disk file to 

memory. 
2BC6 

Command ME. Sets the vectors for memory 

input and output. 
2BDD 

Command PU. Puts named file on disk. 
2BFD 

Command RE. Returns from OS65D to 

linked software. If software is not in 

memory, return set to 2AC0 for error #7 

out. Settings as follows: ASM to 1303; EM 

to 1700; BA to 20C4; and M to FEFC 

(which jumps to FEOO). 
2C22 

Command XQ. Load (starting at 3179) 

and execute (starting at 317E) a named 

program 
2C28 

Command SA. Save memory on a specified 

sector and track of the disk. 
2C43 

Command SE. Select a disk drive 

(A,B,C,D,). 
2C60 

Get the disk ready for a read or write 

on a given sector and track. 
2C70 

Buffer loader. Set the disk start vector 

to 3179. Engage the disk head. 
2C83 

Advance head one track. Check for the 

last track in a file. Report error #D 

if a read goes beyond the last track of the file. 



2C98 

Carriage return, line feed, then: 
2C9B 

Enter and edit a line in the OS65D line 
buffer at 2E1E - 2E2F. 
2CD3 

Three empty bytes. 

2CD6 

Routes input to the Indirect File. 

2CE4 

Read a line from the OS65D line buffer 
software, one character at a time. 

2CF7 

Swapper routine. Switches 0-page and 
stack for 2 F7 9 - 3178. 

2D23 

Read 4 ASCII hex digits from the buffer and 
convert to 2 bytes of bmary. Store in FE, FF. 

2D2E 

Read 2 ASCII hex digits from the buffer 
and convert to 1 byte binary in 
accumulator. 

2D3D 

Read 1 ASCII hex digit from buffer and 
convert to 1/2 low byte binary in accumula- 
tor. Enter at 2D40 with digit in accumula- 
tor to skip buffer read. 

2D50 

Swapper flag check. Initialize for a return 
to BASIC aficr an error message. (See BA 
addresses 20D7 and 20C7). 

2D58/2D3B/2D53 

Check character to see if it is ' = ', ',', 
or 7'. Three entry points. Two hidden by 
BIT instructions. 

2D6A 

Carriage return and line feed. 

2D73 

Display embedded text. Display text from 
the JSR 2D73 instruction until the next 
null (00). 

2D92 

1 byte binary in accumulator is converted 
to 2 ASCII hex digits and displayed in order. 

2D9B 

Low half byte binary in accumulator is 
converted to I ASCII hex digit and 
displayed. 

2DA6 

Directory search. The code from 2DA6- 
2E1D searches the DISK DIRECTORY to 
match a file name in the OS65D Buffer 
with one in the DIRECTORY. When a 
match is found, the track numbers of the 
file are saved: last track in OOE.'J; first 
track in the accumulator. If a track number 
(rather than a file name) is given then the 
track number is read from the line buffer. 
This routine is used by PU and LO to pro- 
cess the DISK DIRECTORY. 



92 



COMPUTE! 



Feofuary, 1981 Issue 9 



2E1E-2E2F 

OS65D Line buffer. 
2E30-2E77 

OS65D Command directory. 4 bytes per 

command. First two bytes = First two 

ASCII letters of Command. Second two 

bytes = Address of routine - 1. 
2E79-2F78 

DISK DIRECTORY buffer. 
2F79-3078 

Buffer for Swapper, Swapped 0-page and 

stack put here. 
3 179-3 17 A 

Source file start address. (317F if no disk 

buffers, 3D7F for one buffer, and 497 F for 

two buffers. Address as low byte - high 

byte. 
317B-317C 

Source file end address. Address as low byte - 

high byte. 
317B-317C 

Source file end address. Address as low 

byte - high byte. 
317D 

Number of disk tracks needed to store 

source file. 



COMMAND PROCESSOR ($2A84) 



317E 



Null (00). 



OS65D COMMAND DIRECTORY 




LOCATION 


COMMAND 


ROUTINE 


ADDRESS 


2E30 


AS 


DD 


2A 


2E34 


BA 


E5 


2A 


2E38 


CA 


10 


2B 


2E3C 


D9 


BF 


2A 


2E40 


DI 


28 


2B 


2E44 


EM 


2E 


2B 


2E48 


EX 


36 


2B 


2E4C 


GO 


45 


2B 


2E50 


HO 


62 


26 


2E54 


IN 


54 


2B 


2E58 


lO 


82 


2B 


2E5C 


LO 


A6 


2B 


2E60 


ME 


C5 


2B 


2E64 


PU 


DC 


2B 


2E68 


RE 


FC 


2B 


2E6C 


XQ 


21 


2C 


2E70 


SA 


27 


2C 


2E74 


SE 


42 


2C 




Pui DIH addr 
on .STACK 




FIGURE 2 




Movf DIH |ilr 
i(j nut CO.MMAN'I) 



FeDtuory. 1981 Issue 9- 



COMPUTE! 



93 



OPERATING SYSTEM ORGANIZATION 



L-flLIIIES 



KERNEL 




FIGURE 1 



LINE liL FFER FILL (S2C!m) 
><= 



Sii BLFF 
,kL- (S2CED) 



Hf,ci BLKK 
INDEX 



[ II put char 




Di-cr BUKE 
pir 






intr BUFF 
rNDF.X 




Put chir ill BUFF 

Send ERASE 

string; 




FIGURE 3 



9d 



COMPUTE! 



Febiuory. 1981. issue 9 



DIRECTORY SEARCH (S2DA6, S2DCE) 



S2dc:e 



S2DA6 



Sft I:i5[ 

TRACK * 

to 76 



Set BUFF ptr 

lo FILENAME 

start 



$2D1}2 



Put 7G 

at DIR 

start 



Read 

TRACK # 

from 

BLFF 



RTS 




Set BUFF 

pir to 

FIUKNAMF. 

Stan 



Move 
DIR pif 



S2DF6 



S;i\-e BL'FF pir 
Stl DISK 
SECTOR <r 



Stnd 
ERR *C 



t2E08 
ves 



S(l DIR 

LOAD ptr 

LOAD DIR 

SECTOR 

Rc5cl DIR 

ptr 





1 



Rtsci DIR 
ptr 



i(- 



Read BUFF 



S2DD3 




no ^ 



S2DDC 




RTS 



FIGURE 4 



February, 1981 Issue 9. 



COMPUTE! 



95 



Book Review 

SERVICING DATA 
FOR COMPUTER 
BOARDS 600 
AND 610 

Published by Howard W. Sams 

and Company, Inc. 

8/2 X 11" Soft cover, 36 Pages, $7.95 

Review by Charles L, Stanford 

Howard VV. Sams has long been the premier 
publisher of electronic service data. Their Photofact 
series covers virtually every audio and audio-visual 
component available in the free world today. Their 
technical book line is likewise extremely comprehen- 
sive. Collaborating with them in the production of 
this service manual (and one for the C4P) may well 
have been one of the wiser moves OSI has made in 
the area of documentation. 

Don't get the idea that this booklet is all things 
to all people. As implied by the title, only the basic 
data needed for effective servicing of the machinery 
are included. But it's all there, including schematics, 
block diagrams, oscilloscope waveforms, parts lists, 
and annotated photographs of the boards. The text 
Includes servicing precautions, disassembly instruc- 
tions, and a troubleshooting guide. 

The guide assumes a fairly thorough knowledge 
of servicing techniques. Beyond that, enough infor- 
mation Is provided to isolate defective components or 
board sections, including a chip-level memory test. 
To aid in tracing signals, various components on the 
achernatic are color-coded by function, such as video 
signals, RAM, crystal oscillator section, etc. 

The schematics and photographs arc on three-or 
four-section fold-out sheets, which minimizes tracing 
signals from one side of a page to another. The 600 
and 610 boards are shown separately, with jack J 1 as 
the common connector. 

The parts list shows both the OSI designation 
for each component and a cross selection chart for 
most. For example, the IC chart lists eight manufac- 
turers, and the capacitor chart three. Only a few 
items such as the ROMs and PROMs, rare ICs, 
some connectors, etc., show only OSTs part number. 

If you never expect to open the case of your 
CIP, don't bother with this book. But if, like me, 
you enjoy the "hardware" side of microcomputing, 
don't pass it up. q 



All About 

OSI 

BASIC-IN-ROM 

Reference Manual 

computell.: "...any of several sections of 

this very well presented manual are worth 

the purchase price" 

Aardvark Journal: "It is the book you were 

hoping was packed with your computer at 

the factory" 

PEEK{65): "in goes far enough. ..to hold the 

interest of advanced programers as well as 

novices." 

Complete, concise, accurate, detailed. 

USR(X), Bugs. Tapes: BASIC, autoload and 

homemade. Source code and variable 

tables above $0300. Memory maps: $00,01, 

02,A000-BFFF. Line-by-line description of 

MONITOR in $FE,FF. 

S8.95 from your dealer 

or postpaid from me. 

Edward H. Carlson 
3872 Raleigh Dr. 

Okemos, Ml 48864 



OSI SOFTWARE 

^^^ NOT your ordinnry STAHTSxX jaae, VlUEOlilEK 1 U & non-stop 
^ A^Ufcll *^tlon chase arountl the gilaity In pursuit of Invading 
iJlflr U I n^ KllnBOn cruietTt. SlmTS, planets nni Black Kolca all 

■ I W fc " jcunt t* avoliied — wii watch oul Tor the DcOEBiJHy P-flchlnel 

■ four chMllenglng levels of play wUh bonufi tine for high 
uoorc. if you Urc ;JTaRTREI1 or TIlitErRM. this Is your ri«arl .tV.9S 

The Hctol Alllunce 13 In liaJlBtrt Jt'it up to. you ard your 
iC-lflntf rir?hter to catch the TIE flghterfl In yo'ir Sector 
iiid deatray as ttany aS you HOn. Tht TIE flffhters dodge 
so q'jlcldj' th«c your targeting cooputer Is an a-jtonatlc 
fir* qontroJ. while your hands are full juet lining up 
target^!' The graphics In this one will Shiee you forget 
Trent Of your co-spuEer, Thr«« iuMla. ..*.*$'?49^ 

flat-r-ld the notorious Red BaronI Tour Squadron conBlatn 

of thrcB Spada and It's, a tate itgalnjl tlee as you try 

lo down as isany tnfVty planes n& you can b«fare your 

fuel ruhe out. Three leTels of illfflculty. UaLl'll you 

s^* whut happens when you h■^F'e to ball out -ifter Tuntnlrbg 

out Of g!iE or getting shot domi by the Baron I 17-95 

I I '" "1 AS Tank Connsanaer, your alaalon Is to blu*' up dll the 

I ^p I * ^^ I AbandoTied gun eoplftcenienta on Zht battlefield. lour 

l~lTAMK MAZi I J task iB CDiapllCat;e4 ^7 the othar objocta In the al-ea 

H' I * I ho>«eVtr. Hlnea, trees, houaea (md clvUlartS ttUBt be 
^ ^ ■ ■ affolded aci you race to coaplete your Blsalon In tloe. 
Kuth HHie Is aiTT^r^nl, and rach contains sTer 200 obJlaelcS. 17.95 

^^ ^■^■■■■k 1^ eneny tanU La plaoLn^; b«i,rrlerj on the battlcrinld. 
BARhIUH rchu DUat deJCroy t^he enei^r tanktj to Ketip the ana open. 
AE the ^nBa gova on, the open SpaC*s rtplily disappear, 
YAlSBr =ftklng tho Job aore dirriciJlt, T-o loMla of difficulty. 

"^■^•■^ In LeWel ^ they're laying eiploalTC aln,a«1 •?.95 

•N£U NEW ^'EU* 

G_A fast paced, frantic chase around the screen, T:rylTig to 
B catch dome ¥#ry elusive tarsets. It's a race against the 
■cioelt as yo-3 try to roll up thtr highest possible score. 
■ fIv? levels of play aJid bonus tlae for high secre! Tfou'll 
understand the na=e Hhiin you try Level 51 17-95 

The E*r!.h Is In « p^inicl Sflucera oro conin,j to open a nmv 
conjjj yo Peopleburgor franchiser Can you atop thea? Two leTela of 

„ , „^„_ Jirriculty. Thla on« la Slapler to pUy th*n thrt o-.h*ri. 

FLViNG 5flLICEn5 ^,itn only on« b-Jtton to push, but U*a still quite a good 
challenge. ♦^■50 

All prices are po3:^pil-1-no -hlilen" nandllng charges. All r^n In BK on any 
oai C- 'ZZ or C^ tape Sasfld =o=pu--er. All are reior^lei twice on eaih tmps 
and are coirercl by a lliltel repiace=ent «rranty. return f^r repl»5»^»nt, 

BOB RETELLE 

BOOBWHITTAKER R0.,YPBILANTI,MI.48187 



96 



COMPUTE! 



Februorv. 1081 Issue 9 



JINSAM 

DATA MANAGER 



SAVE TIME. SAVE MONEY. 
Let JINSAM work for you. 



JINSAM data manager assists you by intellect- 
ually manipulating records. 

No more will hundreds of valuable hours be 
spent searching for needed infonnation. No more 
will hundreds of hours be spent entering and re- 
entering infonnation for various reports. 

With JINSAM you can truly transfonn your 
Cotnmodore Computer into the "state of the art" 
data processing machine wth sophisticated fea- 
tures and accessories found nowhere, even at 10 
times the price. 

There are three disk based JINSAM. JINSAM 
1 .0 allows fast and easy file handling, manipulation 
and report generation. JINSAM 4.0 was designed 
for the professional and contains features needed 
in the business environment, such as: JIN SORT, a 
user accessible machine language sort; compac- 
tion/expansion of databases, merging databases 
and much much more. JINSAM 8.0 is our best. 
JINSAM 8.0 runs on the new Commodore 8032, 
80 column display computer. JINSAM 8.0 has 
all the functions of 4,0 plus additional features 
found only on the most sophisticated and expensive 
database management systems. 

JINSAM is a new breed of data processing soft- 
ware. Powerful, sophisticated and easy to use. 
JINSAM has been thoroughly field tested. JIN- 
SAM is now installed and saving its users 
valuable time and money in educational institu- 
tions, research institutions and offices nation- 
wide. 

JINSAM was designed with the user in mind. 

It is a forgiving system with help commands, 
prompts and utilities for recovering the bulk of data 
even after power failure, security passwords for 
privacy, editing, reclaiming space, auto recall, re- 
structuring, unlimited report formats, label printing 
and a choice of accessory modules all accom- 
plished by a few keystrokes. 
JINSAM has 5 accessory interfacing modules: 
WORDPROPACK- Intelligent interface for 
WORDPRO 3 or WORDPRO 4 which creates 
variable block with data or up to 10 conditions 
based on database contents. Produce "dunning 
letters", form letters, report to parent, checks, 
invoices, etc. 

MULTI-LABEL- Prints multiple labels per 
record with up to 2 lines for messages and con- 
secuti\'e numbering. Produce inventory, bulk mail 
labels, etc. 



• CUSTOM DATA FILES 

• CUSTOM REPORTS/UVBELS 

• KEYED RANDOM ACCESS 

• FAST/EASY/MENU DRIVEN 

• MULTIPLE SEARCH KEYS 

• PRIVACY ACCESS CODES 
•WILD CARD SEARCH 



"JINSAM is the best Database 

Management System for the 

Commodore Computers I 



The many features of JINSAM 1 .0 —8.0 



m 



MATHPACK- global +, -, x, -, by another 
field or a constant, or zero a field. Sum fields in 
each record or running sum of single field in ail 
records. Extract information or effect permanent 
change. Replace in same field or place in a wait- 
ing field. 

DLSCRIPTIVE ST.A.TPACK-Detennine 
mean , median , mode, standard deviation , variance, 
range. Generate histogram and produces Z-Score 
report. 

ADVANCED ST.4TPACK - (you must also 
acquire DESCRIPTIVE STATPACK). Gener- 
ates CROS STABS (number of occurances); CHI 
SQUARE. LINEAR REGRESSION with 
graphic representation and prediction, LINEAR 
CORRELATION and SIMPLE ANALYSIS OF 
VARIANCE. 

All JINSAM accessories are accessed thru 
the JINSAM menu and require a security password 
to gain entrance. 

JINSAM gives the user FREEDOM OF 
CHOICE. Start with JINSAM 1.0 and upgrade 
at any time. Choose from the accessory modules 
available at any time. JINSAM Newsletter brings 
the latest updates, user input and keeps an eye on 
the future. 

JINSAM alone is reason enough to own a com- 
puter. JINSAM can be found at Commodore 
dealers. Write for the dealer nearest you. 



of JINSAM 1.0 functions Plus + machine son 
with user access instructions • sort 1000 records 
inapxlOsecs • Global Compaction/Expanlion 
• Create new database from existingdatabasc • 
merge databases. Includes MULTI-LABEL • 
4 deep subsorts. (Available Jan. 13. 1981) 

JINS.^M 8.0 for Model 8032 with 80 Column 
screen. Requires 2040 or 8050 disk. Commercial 
Disk version for 80 Columns, JINSAM 4.0 func- 
tions Plus + Displays report formats to screen, 
4 deep subsorts. (Available Jan. 1, 1981) 



JINSAM ti 1 inilcinirk of JINI MICRO-SYSTEMS, Inc. 
WordPro It ■ mdcmirk of ProfMiiani! Softwirt Inc. 
CBM li a indcmirk of Coranodorc Builncti Miclilati. 



JINSAM Data Manager 

for Commodore Computers 

— Additional Information 

— Jinsam Demo Disk (SIO, plus ta.x) 

— Users Guide 1.0 (S25 plus ta.x) 

Please send to: 

Name 



q^ Address 

City, State, Zip . 
Phone ( ) _ 



JINSAM l.0forl6K/32KCBM2001. Requires Position . 
CBM 2040 or COMPU/THINK disk — including Company 
oldest ROMs. Menu Driven, ISAM -Indexed 
Sequential access method • Encripted PASS 
WORDS for privacy • Unlimited fields • un- 
limited search criteria • 3 deep subsorts • 
.5-3 sec retrevial • editing • Auto Recall • 
Wild Card Capabilities: Reports: multiple head- Computer, Disk 
ings • paging • page numbering • item 
count. Labels: any size • 1-5 across • sheet 
or continuous. Utilities: Help commands • Re- 
cover • Key Dimip # Record Dump • De- 
scriptor Dump • Restructure. 

JINSAM 4.0 for 32K CBM 2001 with BASIC 
4.0. Requires CBM 2040 with DOS 2. 1 . Has most Dealer inquiry welcome 



JINI MICRO SYSTEMS, INC. 

Box 274 • Riverdale, NY 10463 



FebruOTy. 1981 Issue 9 



COMPUTE! 



97 




Contour 
Plotting 



Neal E. Reid 
Parkside High School, 
Dundos, Ontario 

In the July/ August issue of COMPUTE (p. 73) John 
Winn showed how to use the 2022 printer to produce 
graphs of functions of one variable, f{x). Two 
features of the printer made it possible to increase 
the resolution from that of a printed character to that 
of a single printer matrix dot. First of all, the user 
can define special characters to print any one of the 
matrix dots alone in the character space. Secondly, 
because of the variable line spacing on the printer, 
the character and thus the matrix dot can be printed 
anywhere on the paper. 

The object of this article is to show how to pro- 
duce graphs of functions of two variables, f(x,y). I 
am using a 2023 friction feed printer which does not 
have the variable line spacing capability. As a result, 
gaps sometimes appear in the plotted lines, but these 
are readily filled in by the eye and do not seem to be 
a serious defect. 

One cannot approach the problem of graphing a 
function of two variables in the same way that one 
does a function of a single variable. In f(x,y), x and 
y are both independent variables. A particular pair 
(x,y) represents a point in a plane and the value of 
the function represents heights above or below the 
plane. I like to picture f(x,y) as a physiographic map. 
X and y correspond to distances in the east-west and 
north-south directions, respectively. The function 
corresponds to the elevation at a particular point 
(x,y) on the map. Points at which the value of the 
function is zero are at sea level. Positive values of 
f(x,y) are above, negative values, below sea level. To 
represent such a function on a two dimensional sheet 
of graph paper, one plots lines oi' equal elevation- 
contour lines. A line connecting the points where 
i'(x,y) = 0, for instance, would be the shore line on a 
physiographic map. It is customary on such a map to 
show a constant change in elevation from one con- 
tour to the next. Then in regions where the contour 
lines come very close together, the slope of the land 
must be very steep - moving a short distance 
horizontally changes the elevation a great deal. Alter- 
natively, if the contour lines are very widely spaced, 
then the terrain is relatively ilat. 




. 337333333 



INTERFERENCE OF TWO CIRCULfiR WflVES 
RANGE OF X: -6 TO S X- INCREMENT: 

RflNijE OF V: -6 Id 6 V-INCREMENT: 

CONTOURS: 1.5 ,s . ;: -,3 -,9 -1.5 
PLOTTING TIME: 40.4 MIN 



In setting out to draw contours of a function of 
two variables, the first things to consider are the 
scale and the position of the graph. The position is 
fixed by choosing the center of the graph to be at 
some particular point (XOYO) in the xy plane. 
Then by adjusting the scale, one can display a large 
area or a small neighborhood of that point. Giving 
the width XR of the graph from the center to the 
edge will fix the scale. This restricts x and y both to 
a limited range of values. Thus it is not necessary to 
print out the graph standing on its side in order to 
let X have an unlimited range as is usually done with 
functions of a single variable. 

The physical size of the final graph depends on 
the number of characters per line and the number of 
lines printed, and this in turn determines the values 
of the increments in the x and y directions, The 
printer character matrix is 6 dots wide and 7 dots 
high with a 3-dot spacing between the lines. By 
choosing the dimensions of the graph to be 60 
characters wide and 36 lines long, we end up with a 
360x360 dot square, 6 inches on a side, which fits 
nicely on an 814x11 sheet of notebook paper. The 
boundary of this region is made using a special 
character MKS consisting of the single dot in the up- 
per left hand corner of the print matrix. It is printed 



9B 



COMPUTE! 



Februorv. 1981 Issue 9 



aroimrl al! four sides of (de square. Moving across 
thfc page, the x increment, the change in x from one 
dot to the next, is XR/30 (center to edge width/30 
charartcrsV If the graph boundary were a perfect 
squaie, then the y increment would be XR/18. On 
my printer, however, the vertical dimension cornes 
out about l/!6 inch longer than the horizontal. For 
truly preci.sion work, one should correct for this; 
thus, the peculiar factor in line 1035 arrived at pure- 
ly by trial. The scale, increments, etc., are all taken 
care of in the SET UP .subroutine starting at line 
900. The increments and ranges of x and y are 
printed out at the end of the plot. With this informa- 
tion, these dots on the boundary provide an accurate 
scale for the final graph. In addition, there are tick 
marks on the edges to locate the exact center of the 
graph. 

The procedure to create a contour plot for a 
given function is now straightforward. First, values 
of the function are calculated at points spaced 
uniformly over the entire page using the increments 
of X and y previously worked out. Then we examine 
every pair of points to see if the contour passes 
between them. The points at which the function is 
calculated are those corresponding to the dot in 
the upper left hand corner of each character. Actual- 
ly this is done only one line at a time in the 
subroutine beginning on line 400. After finishing two 
lines, we have the situation depicted in the diagram. 
The open circles are the points at which the value of 
the function is now known. 

To find out if the contour we are interested in cuts 
through the space occupied by the first character, we 
test to sec if the value of the contour lies between the 
values Fl(l) and F2(l) on the horizontal line. This 
test is made in line 600. If the test is passed, then the 
particular dot at which the contour cuts the top edge 
of the matrix is found by linear interpolation. This 
test is repeated in line 610 for the vertical line 
between Fl(l) and F2(l). Each character space is 
examined in the same manner, and whenever a con- 
tour crossing is found, a dot is printed on the left 
and/or top edge of the matrix. Dots on the left edge 
which fall into the space between two lines cannot be 
printed. Other dots in the matrix are never printed. 
When the first line of characters is completed, the 
functional values in F2 are shifted into Fl and the 
next line of values is put into F2. This way the pro- 
gram never requires more than two lines of values in 
memory at any one time. 

I have used the function f(x,y) =x'^ + y^ as a 
sort oi test pattern to check out the program. The 
contours of this function arc circles centered at the 
origin. The accuracy in the positions of the plotted 
points can be checked with a compass. (The user 
should check this for himself.) If the width XR is set 
equal to 3 and the contour values arc taken to be 
0.25, 1.00, 2.25, 4.00, 6.25, and 9.00, then the radii 
of the circles differ by V2 inch from i4 to 3 inches. 



I . .-. , ... 

TEST pfiTTERU - COMCENTRIC CIRCLES 
RfiHGE CiF y.-- -3 TO 3 X-IHCREMENT 

RflHOE OF V: -J TO 3 V-IilCREMEMT 

CCiNTOURi- .25 1 2.25 4 6.25 9 

PLOTTING TIME: 23.? MIH 



, i 66666667 



. -^ - 

..... ..^ . 

1 ■ 





FLUm FLOW fiROUND B SPHERE 

RANGE OF y.- -2.5 TO 2.5 X- INCREMENT: .6833333333 

RRNGE OF V: -2.5 TO 2.5 V-INCREMENT^ .146555536 

CONTOURS: 2 1.6 1.2 .8 .4 6 -.4 -.6 -1.2 -1.6 -2 
PLOTTING TIME: 38.6 MIN 



February. 1981, Issue 9 



COMPUTE! 



99 




Skyles Electric Works 



QYour students are gathering around the several PET computers in your 
^ classroonn. And they all are hungry for hands-on turns at the keyboards. 
Some students are just beginning to understand computers; others are 
so advanced they can help you clean up the programs at the end of the period. 
How do you set up a job queue, how do you keep the beginners from crashing a 
program, how do you let the advanced students have full access? And how do you 
preserve your sanity while all this is going on? 




A. With the Regent. 
Q. What is the Regent? 

A The ultimate in classroom multiple PET systems. A 

surprisingly inexpensive, simple, effective way to have 
students at all levels of computer capability work and learn 
on a system with up to 15 PETs while the instructor has 
complete control and receives individual progress reports. 

Up to 15 PETs, one dual disk drive and as many as five 
those good things we promised. Ifs designed to operate with 



printers can interface with the Regent, and do a 

8K, 16K, 32K PET/CBM models and with the Commodore disk drives and new DOS 

Five levels of user privilege, from the Systems Level, 
through Levels One and Two, Student: Levels One and 
Two, Operator. From only the use of system commands 
to complete control for the exclusive use of the 
instructor. 



There's complete system protection against the novice 
user crashing the program: the instructor has total 
control over, and receives reports concerning, usage of 
all PETs. 

A complete set of explanations for all user commands 
is stored on the disk for instant access by all users. 
And a printout of the record of all usage of Regent is 
available at the instructor's command. 

The Regent includes a systems disk with 100,000-plus 
bytes for program storage, a ROM program module, 
together with a Proctor and a SUB-it . . . and complete 
instructor and student user manuals. 

Q. SUB-it? Proctor? What are they? 

J| The SUB-it is a single ROM chip (on an interface 
board in the case of the original 2001-8 models) 
that allows up to 15 PETs to be connected to a 
common disk via the standard PET-IEEE cables. The 
Commodore 2040, 2050 or 8050 dual disks and a 
printer may be used. 

{The SUB-it has no system software or hardware to 
supervise access to the IEEE bus. The system is thus 
unprotected from user-created problems. Any user — 
even a rank novice — has full access to all commands 



and to the disk and bus. This situation can. of course 
be corrected partially by the Proctor, completely by the 
Regent.) 

The SUB-it prevents inadvertent disruption when one 
unit in a system is loading and another is being used. 

The Proctor takes charge of the bus and resolves 
multiple user conflicts. Each student can load down 
from the same disk but cannot inadvertently load to or 
wipe out the disk. Good for computer aided instruction 
and for library applications, offering hundreds of 
programs to beginning computer users. 

A combination of hardware and software protects the 
disk from unexpected erasures and settles IEEE bus 
usage conflicts. Only the instructor or a delegate can 
send programs to the disk. Yet all the PETs in the 
system have access to all disk programs. Available for 
all PET/CBM models. SUB-it and PET mtercontrol 
module and DLW (down-loading software) are included. 

Q, How expensive are these classroom 
miracles? 

A We think the word is inexpensive. The Regent 
• system is $250 for the first PET: $150 for each 
additional PET in the system. The SUB-it is S40. (Add 
an interface board at SZ2.50 if the PET is an original 
2001-8.) And the Proctor is $95. 

There are cables available, too: 1 meter at $40 each: 
2 meter, S60 each: 4 meter, S90 each. 




Phone or write for information. We'll be delighted to answer any questions 
and to send you the complete information package. 



Skyles Electric Works 



231 E SoutK Whisman Road 
Moui\tairv View, CA 94041 
(415) 965-1735 



lOO 



COMPUTE! 



^ebruorv. 1981 Issue 9 



The user should set his own function equal to F2(J) 
in line 440. 

The second diagram is an example of a typical 
contour plot. It shows the equipotential lines in the 
magnetic field of a bar magnet. The north pole of the 
magnet, which has been drawn on the plot, is at x = 
-1. The south pole is at +1. The potential at an ar- 
bitrary point in the plane is given by the function. 
1 - 1 



f(x,y) =[/ (x + ly + f 



\l(x-iy 



r 



The lines of force start at the north poie, end at the 
south pole, and arc everywhere perpendicular to the 
contours. The program does not label the contour 
lines, but it is not difficult to figure out which is 
which. For one thing you can plot one contour at a 
time until you see where they lie. In this plot the 
contours increase toward the left from zero on the y 
axis to .1 which is the innermost one. They decrease 
to the right. The plotting time increases with the 
complexity of the function and with the number of 
contours. Each plotted point requires an excursion of 
the print head across the page. 

One potential source of trouble is the possibility 
of a division by zero. In this plot, for instance, this 
could happen at the positions of the poles. In fact, 
around the north pole there is a peak which becomes 
infinitely high at the pole, and at the south pole there 
is an infinitely deep hole. (Notice the cliff between 
the poles where the contours coincide!) In practice it 
is a simple matter to select the center of the graph 
and the scale so as to avoid having to evaluate the 
function at these troublesome points. The point 
(.00001,. 00001) is indistinguishable from the point 
(0,0) to the eye but it makes a difference to the com- 
puter. 

This plotting routine can be used for any rela- 
tionship that can be expressed as a funciton of two 
variables. Some examples which the reader might 
find interesting to try out are given below. I am sure 
there are many others. On the other hand, it is of 
great interest just to experiment with functions of all 
sorts and sec what turns up. 

1. Interference of circular waves. Two pebbles are 
dropped into a pond at the points x = +2 and -2. 
Draw circles of radii 1 and 5 around these points on 
the finished graph. These show where the peak of 
each circular wave lies. Maximum values of the func- 
tion occur where two of these circles intersect. The 
wave troughs are half way in between at radii of 3 
and 7. 

f(x,y) = SIN(f \l(x-2y + /) + SIN(f ]/(x + 2-')+y) 



Center: (0,0) Width: 6 
Contours: !..'>, .9, .3. -,3, 



.9, -1,5 



2. Fluid from around a sphere. (Draw a circle of 
radius 1 on (he finished plot.) The contours are lines 
of the velocity potential. The fiow of the fluid is from 
right to left. The stream lines of the flow are 



everywhere perpendicular to the contour lines. Near 
the sphere they hug the surface. 



f(x,y) = X + '2(x' + f)'" 
Center; (0,0) Width; 2.5 y ^y 

Contours: 2.0, l.fi, 1.2, .8, .4, 0, -.4, -.8, -1.2, -1,6, -2.0 
3. The distribution of matter in the nucleus of 

Neon-20. This is what you could expect to see if 

you could slice open the nucleus like an apple. 

/(xj) = (1.5 + 2x2 +2y4)EXP(-(x2 + y2)) 

Center: (0,0) Width: 2 

Contours: 1.4, 1.,'}, 1.2, 1.1, 1.0. 0.9, 0.8 




DISTRIBUTION OF MATTER IN NEON-20 

RRNGE OF X: -2 TO 2 X-INCKEMENT: .0666666667 
RflHGE OF V: -2 TO 2 V-INCREMENT " . U2'f4444'I 

CONTOURS: 1.4 1.3 1,2 1.1 1 .3 ,6 
PLOTTIHC TIME: 33.2 MIN 



\ 

1 \ 



3 



^ 



Fl 



\ 





o 





//// 


y//- 


-k// 




o 


o 


o ^ ^ 





Februoty. 1961. Issue 9 



COMPUTE! 



lOl 



DR. DALEY'S BEST MaiUng List Is Now Better! 



DR. DALEY has taken his best selling mailing list and made it even better! This version has 
been totally revised to increase the reliability of the files and make it even easier to operate. 
Several new features have been added: 



• Goof-proof input routine. Eliminates the irritating results of accidentally pressing 
some cursor control keys. This is a machine code routine so it is as fast as you are! 
BONUS— Auto repeat on all keys! 

• Interface to allow output of the entire mailing list or virtually ^NF subset to WORD- 
PRO III and WORDPRO IV format files so you can use these to generate personal- 
ized form letters. YOV can format the structure of this output! 

• Routines to merge files and to minimize the number of duplicate entries in a file. 

• More machine code routines to speed up processing. 

• In addition you have the same powerful file formatting options where YOU can 
determine the structure of the files. rOt/ can format your label output with up to 11 
lines per label and from 1 to 8 (yes EIGHT) labels per line. 



This system is completely menu driven. It includes 100 pages of user documentation. This 
documentation is for the end user and is not padded with listings, flow charts, and other such 
extraneous material. 

This program will be available for a short time at the introductory price of $159.95. It is 
available for the 32K PET and CBM 3000, 4000 and 8000 series computers. You can order 
through your dealer or directly From us. We will accept VISA or MASTERCARD or your check 
or monev order. Overseas orders include lO^ to cover shipping. 



Charge to 

your 

MC/VISA 





DR. DALEY'S Software 

425 Grove Avenue, Berrien Springs, MI 49103 

Phone (616) 471-5514 

Sunday - Thursday noon to 9 p.m., Eastern Time 



102 



COMPUTE! 



February, 1<?81 Issue 9 



50 

51 

52 

53 

54 

60 

61 

62 

63 

100 

101 

110 

120 

130 

140 

150 

160 

170 

180 

190 

200 

210 

215 

220 

230 

240 

250 

260 

270 

280 

290 

300 

310 

320 

330 

340 

350 

360 

370 

380 

399 

400 

401 

402 

403 

404 

410 

420 

430 

440 

450 

499 

500 

501 

510 

520 

530 

540 

550 
560 
570 
580 
590 
600 

610 

620 



REM 
REM 
REM 
REM 
REM 

REM 
REM 
REM 



* * * 



CONTOUR PLOTTER 



NEAL E. REID 
PARKSIDE HIGH 



SCHOOL 



DUNDAS, ONTARIO 



UP 



REM MAINLINE 

GOSUB 900 : REM SET 

PRINT#1, TAB(31)"i" : GOSUB 800 

LN=0 : PRINT "\^LINE NUMBER iif'^" 

GOSUB 400 : REM COMPUTE F2 

LN=LN+1 : PRINT "T"LN 

FOR 1=0 TO 60 :F1(I)=F2(I) :NEXT 

GOSUB 400 : GOSUB 500 

IF LN<36 GOTO 150 

GOSUB 800 : PRINT#1, TAB (31)"!" 



PRINT#1 
TL$ : PRINT#1 
"RANGE OF X: ";X0- 
" TO ";X0+XR; 

X- INCREMENT; 



"RANGE OF Y: ";Y0-XR 
" TO ";Y0+XR; 

Y- INCREMENT: " 



PRINT#1 

PRINT#1, 

PRINT#1, 

PRINT#1, 

PRINT#1, 

PRINT#1 

PRINT#1, 

PRINT#1, 

PRINT#1, 

PRINT#1 

PRINT#1, "CONTOURS: 

FOR K=l TO NC 

PRINT#1, CT(K) ; : NEXT 

PRINT#1 : PRINT#1 

T%=(TI-TM)/360 

PRINT#1, "PLOTTING TIME 

PRINT#1, T%/10;" MIN" 

CLOSE 1 : CLOSE 5 

PRINT "PLOT COMPLETED" 

END 



XR 



XI 



yi 



REM CALCULATION OF FUNCTIONS 

REM ON 60X36 GRID 

REM ONE LINE AT A TIME 

REM COORDINATES ARE (X,Y) 

Y=Y-YI 

FOR J=0 TO 60 

X=XS+J*XI 

F2(J)=X"2+Y"2 

NEXT J 

RETURN 

REM PLOT CONTOURS 

REM BOUNDARY AND X MARKER - 

PRINT#5, MK$ 

IF LN019 THEN PRINTtl , 

-.)SC$CR$; 
IF LN=19 THEN PRINTfl , 

-.SC$"1"CR$; 
REM LOCATE CONTOURS - 
FOR J=0 TO 59 
A=F1{J) : B=P1(J+1) 
FOR K=l TO NC : NV= 
CN=CT(K) 
IF A<=CN AND CN<B OR A>=CN AND CN>B 

-iTHEN NV=INT(6*(CN-A)/(B-A) )+l 
IF A<=CN AND CN<C OR A>=CN AND CN>C 

^THEN NH=INT{10*(CN-A)/(C-A) )+l 
IF (NH=0 OR NH>7) AND NV=0 GOTO730 



SP$SC$TAB(59 

"l"SC$rAB(59) 



C=F2(J) 
: NH=0 



630 

640 

650 

660 

670 

680 

690 

700 

705 

710 

720 

730 

740 

799 

800 

801 

810 

820 

830 

840 

850 

899 

900 

901 

910 

920 

930 

940 

945 

950 

960 

970 

980 

990 

1000 

1010 

1020 

1030 

1035 

1040 

1050 

1060 

1070 

1080 

1090 

1100 

1110 

1120 

1130 

1140 

1150 

1160 

1170 

1199 



REM CREATE SPECIAL CHARACTER - 

A1=2"(7-NH) :IF NV=1 THEN Al=Al+64 

A2=-64*{NV=2) 

A3=-64*(NV=3) 

A4=-64*(NV=4) 

A5=-64*(NV=5) 

A6=-64*(NV=6) 

A$=CHR$ ( Al ) +CHR$ ( A2 ) +CHR$ { A3 ) 

A$=A$+CHR$ ( A4 ) +CHR$ ( A5 ) +CHR$ ( A6 ) 

PRINT#5, A$ 

PRINT#1, TAB(J+1)SC$CR$; 

NEXT K 

NEXT J 

PRINTil : RETURN 

REM PRINT BOUNDARY 
PRINT#5, MK$ 
PRINT#1, SP$; 
FOR 1=1 TO 61 
PRINT#1, SC$; : NEXT 
PRINT#1, CR$; 
RETURN 

REM SET UP 

DIM Fl(60) ,F2(60) ,CT(12) 

DATA 64,0,0,0,0,0 

FOR 1=1 TO 6 : READ A 

MK$=MKS+CHRS(A) : NEXT 

INPUT "fiTITLE";TL$ 

PRINT "^X,Y COORDINATES OF" 

INPUT "CENTER OF PLOT";X0,Y0 

INPUT "i^CENTER TO EDGE WIDTH ";XR 

INPUT "^^NUMBER OF CONTOURS "; NC 

PRINT "^^CONTOUR VALUES :t" 

FOR K=l TO NC 

INPUT CT{K) : NEXT 

XI=XR/30 :REM X- INCREMENT 

XS=X0-XR :REM X INITIAL VALUE 

YR=XR*1.012 

YI=YR/18 

YS=Y0+YR 

Y=YS+YI 

SP$=CHR$(29) :REM SPACE 

SC$=CHR$(254) :REM SPEC. CHAR. 

CR$=CHR$(141) :REM CAR. RETURN 

OPEN 1,4 : OPEN 5,4,5 

PRINT "^INSERT PAPER" 

PRINT "^PRESS xRETURNf"; 

PRINT " TO CONTINUE" 

GET P$ : IF P$="" GOTO 1140 

IF ASC(P$)<>13 GOTO 1140 

TM=TI : REM SET TIMER 

PRINT "^STARTING" 

RETURN 



REM Y- INCREMENT 
REM Y INITIAL VALUE 



February, 1981. Issue 9. 



COMPUTE! 



103 



Relocate 



R, D. Young 
Ottawa, Ontario 

Mysteries can be solved, eventually. This one begins 
with the article by Harvey B. Herman on 'Memory 
Partition of BASIC Workspace' (COMPUTE!, Issue 
2, Jan. /Feb, 1980, p. 18). Harvey made reference to 
a previously written article in MICRO which was to 
describe the procedure for relocating or loading pro- 
grams to portions of memory other than from the 
normal beginning of memory. Unfortunately, I did 
not have immediate access to his reference, so the 
loading of saved programs into memory partitions 
had to wait . . , indefinitely. 

Some hints on the required procedure became 
available when Roy Busdiecker outlined the reloca- 
tion of the monitor used by us 'old ROMers' in his 
article, 'Relocate PET Monitor Almost Anywhere' 
(COMPUTE!, Issue 4, May/June 1980, p. 115), I 
did not pay much attention to it at the time, but 
memory expansion suddenly made it useful. When 
'Q.uadra-PET' came along (COMPUTE!, Issue 6, 
Sept. /Oct, 1980, p. 90), I was able to piece the puz- 
zle together, but it would have been nice if the pro- 
cedure had been included in the article. 

I suspect that there are still a few 'old ROMers' 
like me out there; I hesitate to buy a new ROM set 
as long as the old one is still functioning. For them, I 
present RELOCATE; a machine language routine 
that loads programs anywhere as simply as a normal 
LOAD. Such a routine may well have been pub- 
lished in the past, but repetition can be useful for 
those whose resources are limited. For new ROMs, I 
suspect that the routine can be appropriately revised, 
and I have liberally commented the listing. 

With this routine, memory partitioning becomes 
a reality. A routine like 'Quadra-PET' that would 
permit switching from one program to another 
without destroying either is the missing link. 

The mystery was solved, exposing yet another. 



os'ia 


20 


36 


E2 


031B 


20 


AE 


F5 


03tE 


AE 


3A 


03 


0351 


AD 


7E 


02 


0351 


38 






D355 


ED 


7C 


02 


1)358 


8D 


3B 


03 


035P 


A9 


01 




tt35D 


EO 


01 




035F 


FO 


i)7 




D3il 


18 






03A2 


69 


O't 




0361 


CA 






03AS 


1C 


'5D 


3 


11368 


8D 


7C 


02 


U3AB 


35 


7E: 





Beg in 



IncT' E? 



l-Oitd 



SELQCATE 


JSR 


57910 


t c'lesT' PicreEn 


JSR 


62891 


; INIT LOAD 


LDX 


826 f 


start location 


LDA 


633 i 


eni,1 lo3d hiGh byte 


SEC 


i 




SBC 


636 ! 


start load hieh bate 


STA 


327 ; 


ciftr.et 


LDA 


»1 i 


r.orrtal start hiEh byte 


CPX 


*i ; 


ready to load? 


E:EQ 


Loa.j 


; YEB 


CLC 


i NO 




ADC 


*i ; 


increnprit bii 11! 


DEX 


* 




JMF- 


Inert 


t 


SIA 


636 ; 


new start hinh byte 


STA 


123 i 


new start BASIC pointer 



036D la 
036E iC 3E; 03 
0371 SD 7E 
0371 A9 



o: 



37 



0376 
0375* BD 
037C A9 



BD IB 81 
19 81 
01 



CLC i 

ADC 827 ! 
STA 63S ; 
LDA #55 ; 
STA 33D18 
STA 33049 



037E SD OD 02 

03(11 A9 OD 

0383 BD OF 02 

0386 1C C3 F3 
03B9 



add DfftiH 
riew end hich byte 
t7 for screen store 
i Line 77 hoF-afulIs 
) not in proeran 
LDA *1 ; dunanic RETURN 
STA 525 i to enter 77 
LDA #13 ; as a line to 
STA 527 ; rfiet line links 
JMP 621U3 ; LOAO 
.END 



LOAD 'RELOCATE' 
NEW 

Rewind cassette to EXACT position for desired pro- 
gram, 

POKE 826, X where X is the desired starting 
location for the load in increments of IK (minimum 
IK). Eg. if X = 7, the program will be loaded begin- 
ning at the 7K (7168 decimal) location. 

Load with SYS 840. Note the contents of loca- 
tions 123, 124, 125, 134, 135 to be able to return to 
this program. To return to the beginning of memory, 
POKE 135, PEEK(123):POKE 123,4:POKE 124,4: 
POKE 125,4:CLR. 




AAOA€ SOFTUJflR€ TOOLS __,_ 
FROM H€S FOR VOUR 8K PET 

by iav Balokrishnan 



HESEDIT: change 22 lines of data by merely over- 
typing and insert, delete, and even duplicate lines- 
all at once! Scroll forwards or backwards by any 
amount— it's also easy to edit files bigger than your 
memory. Why code a program to maintain each file? 
Use HESEDIT for mailing lists, notes or prepare 
assembler source for HESBAL. All keys repeat. FAST - 
written in BASIC and assembler. ONLY S12.95 

6502 ASSEMBLER PACKAGE: HESBAL, a full-featured 
assembler with over 1200 bytes free (8K) & HESEDIT; 
for less than S25! HESBAL is THE best 8K assembler 
available: it uses only 1 tape or disk, yet mcludes 
variable symbol sizes, pseudo-opcodes, over 25 error 
messages and more than 70 pages of documentation. 
After 2/28./61, S23.95. Now, ONLY S15.95 
HESLISTER: formats multi-statement lined BASIC 
programs, shows logic structure (disk reqd.) S9-95 

GUARANTEED to load or replaced FREE 
Order from your dealer or direct from us 
Plus SI. 50 Postage (our doc. is freavy!) 
Disk - Add S3 . Calif Res. - 6% Sales Tax 

°''" '" "' Humon Engineered Softujore 
3748 ingleuLiood Btvd, Room 11 
Los flngeSes, ColiforniQ 90066 

24 HOURS - (213) 398-7259 

Deoler inquiries ujelcomed 



104 



COMPUTE! 



FebPUOfy. 1981 Issue 9 



Mixing and 
iVIatching 
Commodore 
Disk Systems 

Jim Butterfield 

The computer and the disk are separate devices. 
They communicate only over the IEEE-488 bus. Any 
Commodore disk can be worked by any PET/CBM 
system (except the original ROM systems which have 
an IEEE bus problem). 

The newer computers and newer disks seem to 
work well together. But you can mix and match 
older systems with the new to suit your own special 
requirements. 

First, a litde terminology. "New disk" doesn't 
just mean the 77-track 8050 unit. The 2040 units can 
be fitted with equivalent logic which provide auto- 
initialization, file append, and relative files. New 
2040's will be shipped that way, and old ones can be 
retrofitted with new RO.M sets. Disk units that have 
the new features will be referred to as "DOS 2.0" 
systems; the original 2040 units without the extra 
features will be "DOS 1.0" systems. 

Similarly, the 80-column computers give you 
new Basic commands such as SCRATCH or AP- 
PEND; but you can also get these features on newer 
40-column machines, and some older machines can 
be retrofitted. Systems with the new Basic commands 
will be called "Basic 4.0"; the earlier upgrade 
ROMs will be referred to as "Basic 2.0". The very 
first PET units with original RO.Ms won't be men- 
tioned here; they don't work disk at all. 

Why keep the old? 

There are a number of reasons that a user might 
prefer to stay with an older disk or computer RO.M. 

On his computer, he might have machine 
language programs that might be difficult to 
upgrade. He might need all of his spare ROM 
sockets. Or he might just like the old system and see 
no reason to pay extra money to go to the new. If he 
has an early model PET, the new Basic 4,0 might 
not fit — it requires an extra ROM socket that just 
isn't there. 

On his disk, he might not want to give up a lit- 
tle capacity on the new system: DOS 2.0 gives only 
664 blocks as compared to 670 on DOS 1.0, and the 
directory capacity is trimmed to 144 entries as com- 
pared to 152. He might have direct access files which 
depend on the old allocation patterns of the DOS 1.0 
system, and views conversion as too much trouble. 



My personal view is that disk upgrade is 
desirable, but computer upgrade is optional and a 
matter of preference. 

New Computer, Old Disk 

It's quite easy to work a DOS 1.0 disk unit with a 
new Basic 4.0 computer. 

You must remember to initialize each new 
diskette as it's inserted into the unit. The usual way 
is: 

OPEN 15,8, 15, "10" — or any similar sequence. 
All of your new Basic commands will work well, ex- 
cept APPEND and RECORD. These will be sent 
along to the disk, but the disk unit won't understand 
and will return a SYNTAX ERROR message. 

Of course, you can't open a file using the L op- 
tion: relative files are unknown to a DOS 1.0 unit. 

But everything else will work nicely, and you'll 
have the convenience of commands like CATALOG 
or SCRATCH to make things easy. 

One caution: If you should happen upon a disk 
that has been initialized on a DOS 2.0 drive, don't 
try to write on it with your DOS 1.0 system. It 
might work, but it might also wreck the diskette in- 
formation. Copy the files over to a disk of your own 
and you'll be free to make all the change you like. 

Old Computer, New Disk 

All of the old disk features are preserved. You won't 
need to initialize, which is a great convenience. 

You'll probably want to use that old standby, 
the DOS Support Program (the "wedge") to help in 
cataloging and error checking. No problem; 
everything is as it was before. 

When you want to exploit the new features of 
your DOS 2.0 disk unit, you'll have a little more 
work. Appending is quite easy. As an example, sup- 
pose you have a sequential file called R.'\BBIT and 
you want to tack some records onto the end. You 
just open with: 
OPEN 1,8,3,"0:RABBIT,A" 

, .and you're ready to write the extra records. As 
usual, don't forget to close the file when you're 
finished. 

Handling the new Relative files recjuircs careful 
coding. You should, of course, read up on this type 
of file in the manual first. In some ways a relative 
file can be handled in the same way as a sequential 
file. The big differences are in two areas; opening the 
file; and at a later time, positioning so as to read or 
write a specific record. 

To open a relative file the first time, you use a 
conventional OPEN statement. An example will il- 
lustrate the method. Suppose we want to write a 
relative file called RANDEIL, with each record to be 
no longer than 25 characters. We would write: 
OPEN 1,8,3,"0;RANDFIL,L," + CHRS(2.>) 
Following this, as usual, we would write records to 




Introductory Special 

$595.00 

Controller Board, DOS, 
40T Disk Drive & Cable. 

Pedisk II is a small floppy disk controller board that plugs into a ROM socket in vour computer. The board contains all the logic required for a disk 
system as well as space for ROM. It is used with standard 57." or 8" disk drive/power supply housings to form a fast, reliable and inexpensive mass 
storage system The CBS/PDOS software package provides sirrrple yet sophisticated file handling. The extended command set can be executed 
directly or from a program: LOAD, RUN, SAVE, OPEN, CLOSE, INPUT and PRINT. 

RELIABLE - single chip disk controller using IBM 3740 recording 
format gives maximum timing margins - super reliability. 
COMPATIBLE - reak diskettes from other systems - 6502PDS, 
AIM, SYM, and even RADIO SHACK [special software). IBM 3740 
soft sector single density. 

MP! B51 DISK DRIVE (40 track) $269,00 

DISK CABLE (2 drive) S 35.00 

5y/' DISKETTES (box of 10) $ 29.95 

PEDISK II DIAGNOSTIC ROM $ 29.95 



FAST - loads programs at least 3 times faster than 2040. It is the 
fastest disk available for PET. 

SOPHISTICATED - The CRS/DOS op system provides advanced file 
handling, indexed-sequential, but very easy to use. 

PEDISK II CONTROLLER BOARD $229.00 

CRS/PDOS II DOSPACK $ 75.00 

40T DISK DRIVE-HOUSING $395.00 

PEDISK II MANUAL S 10.00 



NEED MORE ROM ROOM? meet SPACEMAKER II 

Switch between one of four ROMS - software controllable. 

Mix and match - ROMS, PROMS and EPROMS; 2332, 2732, 2532, 2716, etc. 

Vertical mount, put several Spacemakers in adjacent sockets. 

ROMDRIVER $39.00 

ROMDRIVER is an accessory ■parallel output port used to control 
Spacemaker ROM selection without using the User Port of the PET. 
The small p.c, board plugs inside the PET and is connected to 
Spacemakers with jumper cables. 



USER I/O $12.95 

USER I/O allows software control of Spacemaker utilizing the PET 
User I/O port. A connector with specially designed jumpers and the 
diskette with control software "SPACECTL" is provided. Available 
on Commodore or PEDISK diskette. 



SPACEMAKER II $39.00 

Spacemaker II is a small p.c board containing four ROM sockets. It 
plugs vertically into any ROM socket in a new PET. The user can 
switch between any of the four ROMS manually or under software 
control using ROMDRIVER or USER I/O. 

ROM I/O S9.95 

ROM I/O is a special utility control software package for ROM- 
DRIVER owners allowing software controlled switching of ROMS. 
The package includes menu-driven selection of ROMS and an "editor" 
to add or delete entries — complete control directly from your 
keyboard. Available on Commodore or PEDISK diskette. 

I full FORTH + I 

INTERPRETER - can be executed directly in an interpretive mode 
to speed testing and debugging. 

CROSS-COMPILER - words can be individually compiled and tested, 
the entire program can also be cross-compiled for maximum efficiency. 

COND. ASSEMBLER - Machine language modules can be intermixed 
and conditionally assembled to fullFORTH. 

SPECIFY PEDISK, 6502PDS, COMMODORE 2040 DISK 

I SBQgPDS J I g5Q2 PROFESSIONAL DEVELOPMENT SYSTEM 

6502PDS: MINI S2695.00 

The 6502 PDS is a versatile multi-card microcomputer designed and programmed for professional engineering and program development work, 
scientific computing, and general processmg. This system provides the maximum in capability at the lowest possible cost by utilizing the industries 
must widely used computer bus ■ the 5100. With a choice of over 500 peripherals including telephone interface, speech synthesizers, vocoders, and 
even associate memory, the potential end use is unlimited. The 6502 PDS is housed in a sturdy S10Q mainfram containing the 6502 MPU, Multiple 
I/O Card, RAM, and Disk Controller Board. This leaves room for future expansion. The system can be connected to any RS232 terminal or used 
with the optional internal Video Board. 



FULL FEATURE "FORTH" FOR 6502 SYSTEMS 

STRING HANDLING - variable length constants and variables are 
allowed. Processes compare, move, concatenate and sub-string words. 

FLOATING POINT - process 5 or 9 digit integer and floating point 

numbers for arithmetic operations. 

SCREEN EDITOR - contains a unique full cursor visible screen 

editor. 

S65.00 



FOR INFORMATION, SEE YOUR DEALER OR: 

TmicrotechI 



P.O. BOX 102 • LANGHORNE, PA 19047 • (215)757-0284 



*PET IS A REGISTERED TRADEMARK OF COMMODORE. 



106 



COMPUTE! 




February, 1981 Issue 9. 



Skylcs Electric Works 



ic™) 



BASIC Programmer's, Toolkit^^, Disk-0-Pro S Command-0® 

For PET® Owners Who Want More Fun 
And Fewer Errors with Their Programs 

Here are thirty-five commands you'll need, all on dual chips you can install in two 
minutes without tools, on any PET or PET system. 2KB or 4KB of ROM firmware 
on each chip with a collection of machine language programs available from the 
time you turn on your PET to the time you shut it off. No tape to load or to interfere 
with any running programs. 

For PET/CBM 2001-8, -8N, -16N/B, -32N/B, 3016 and 3032 
BASIC Programmers Toolkit^-^' commands 

AUTO^'^ DELETE^^ RENUMBER«<^ HELP^'^ TRACE^'^ 
STEpd OFF^<^ APPEND^d DUMP^ FIND^^ 

BASIC Programmers Disk-0-Pro® 

CONCAT^«° DOPENB«° DCLOSE^so RECORD^so HEADER^so cOLLECT^so 

BACKUPsso COPY^s" APPENDB80 DSAVE^so DLOADbso CATAL0G^«° 

RENAME B80 SCRATCH^eo DIRECTORYbso INITIALIZERS MERGERS EXECUTE^s 

SCROLL^" OUr<^ SET^^ KILL^^ EAP-^ PRINT USING^s SEND^s BEEP^s 



?[HVr$IOH Bf ZIRO ERROR IN SM 

READY. 

HELP 



PRESS PLAY ON TAPE 11 
OK 

SEARCHING FOR INPUT 
FOUND INPUT 
APPENDINQ 





NOTES: 

ed — a program editing and debugging command 

B80 — a BASIC command also available on Commodore CBM"^ 8016 and 8032 computers. 
BS — a Skyles Electric Works added value BASIC command. 
BASIC Programmers Toolkit® is a trademark of Palo Alto IC's. 

BASIC Programmers Disk-0-Pro'^, Command-0® are trademarks of Skyles Electric Works, 
PET®, CBM® are trademarks of Commodore Business Machines. 
AVAILABLE: USA/CANADA: Please contact your local dealer 
England; Caico Software Lakeside House, Kingston Hill, Surrey KT2 7QT 
GERMANY: Unternehmensberatung, Axel Brocker Lennebergestr 4, 6500 Mainz 
Japan: Systems Formulate, 1-8-17 Yaesu Shinmaki-cho BIdg. IIF Chuo-ku, Tokyo JAPAN 103 
Phone or write for information. We'll be delighted to answer any questions 
A and to send you the complete information package. 



Skyles Electric Works 



231 E South. Whisman Road 
Mountain View, CA 94041 
(415) 965-1735 



Februory, 1961 Issue 9 



COMPUTE! 



107 




Skyles Electric Works 



BASIC Programmer's, Toolkit®, Disk-0-Pro®, Command-0® 

For CBM® Owners Who Want More Fun 
And Fewer Errors with Their Programs 

Here are nineteen commands you'll need, on a single chip you can install in two 
minutes without tools, on any CBM or CMB system. 4KB of ROM firmware on 
each chip with a collection of machine language programs available from the time 
you turn on your PET to the time you shut it off. 

For CBM 8016 and 8032; BASIC 4.0 



® 



BASIC Programmers Command-0 

AUTO^^ DUMP'' DELETE"^ FIND^^ (improved) HELP^'' KILL^*' OFF^'^ 

TRACE^'^ (improved) RENUMBER*^^ (improved) INITIALIZERS MERGERS MOVE^^ 

EXECUTEBs SCROLL^d OUT^^ SET«^ SEND^s print USING^^ BEEP^^ 



loo oosus lao 

105 PRINT USING Ct. A, B* 

130 INPUT "TIME", D$ 

131 INPUT "DAY", E* 
ISOIFBoCTHEN IDS 

inFonx=rrM 

l«3 PRINT Y(J():NE]CT 
IM RETURN 
20aUX/l9 
READY 

RENUUBEI9 110, 10, 1K-H4 

READY 

usr 

1IXIG0SUB ISO 
no PRINT USING Ct, A, BS 
120 INPUT "TIME", OS 
130 INPUT "DAY", Et 
140 IFBe >C THEN 110 
ISOFORX-nos 
180 PRINT y(X):Ne)CT 
170 RETURN 
200 1=1019 
READY 



MERGE D1 "BUY MOW" 

SEARCHINO FOR BUY NOW 
LOADIHQ 

READY 
RENUMBER 100. 10 

READY 

nNDB* 

110 PRINT USINQ A(.;^.|iS<a«D* 

2»0l=S-"NOWISTHET1ME" 



S«0 BA=B»- 1 
SMRA-m'SWM^^BA'lO 
600IFBA-143T11ENiaa 
CIO RETURN 

■20 c*c"PnoFn's#, imt-t* daily" 

630 PRINT USINQ Ct. PI 

WO 0(-"LOSS S«, *««.«# DAILY" 

050 PRINT USINQ D(. U 

RUM 

PROFIT t1, 230.01 DAILY 

LOSS t 0.00 DAILY 



PRICES: 



NOTICE 

When you order Command-0, we will loan 
you a Toolkit until we deliver Command-0. 

NOTICE 



$40.00 

$75.00 

$75.00 

$20.00-$50.00 

$5.00 




BASIC Programmers Toolkit® (chip only) 
BASIC Programmers Disk-O-Pro^'' (chip only) 
BASIC Programmers Command-0^-^ (chip only) 
Interface boards (needed sometimes) 
Instruction Manual (with redeemable $5.00 coupon) 

Shipping and handling $2.50 USAlCanada, $10.00 Europe/Asia 
California residents please add 6% or 6-112% sales tax as required 
Reserve your Disk-0-Pro, Command-0 today 
Toolkit^ immediate delivery. Disk-0-Pro delivery in December. Command-0 delivery in January 
VISA, MASTERCHARGE ORDERS CALL (800) 538-3083 (except California residents) 
CALIFORNIA ORDERS PLEASE CALL (408) 257-9140 



Skyles Electric Works 



231 E South Whisman Road 
Mountain View, CA 94041 
(415) 965-1735 



108 



COMPUTE! 



February. 1981 Issue 9 



this file — as many as wc think we need — and then 
CLOSE 1. The records may be blank, but we should 
write then anyway since we are building the 
framework into which data will later be placed. 

At a later time, we will wish to read or write a 
specific record in the file. We open the file with a 
conventional statement: 

OPEN 2,8,4,"RANDFIL" : OPEN 15, 8,15 

and now we want to position the file to read or write 
a given record. Let's say we want to write to record- 
number 30. We code: 

PRINT#I5,"P" + CHR$(96 + 4) + CGRS(30) + 
CHR${0)+ CHRS(l) 

What's happening here? Well, the P stands for Posi- 
tion; it's the same as the RECORD command in 
Basic 4.0. 

The CHR${96 + 4) identifies the file as second- 
ary address number 4. The disk unit needs this to 
identify the file that's needed; going back to the 
OPEN statement, it will see that file RANDFIL is 
the one that's wanted. 

CHR$(30) + CHR$(0) says that we want to go 
to record number 30. The second value is the high- 
order byte (multiples of 256). If we wanted record 
number 800, this group would be CHR$(32) + 
CHR$(3). 

Finally, the CHR$(1) means that we want to 
read starting at the first character in the record. 

Afier the positioning is complete, you can then 
INPUT# or PRINT# in the same way you would for 
a sequential file. 

Summary 

You can mix and match disk and computer if you 
wish. Sometimes it's a little more work to get the 
most out of the available features, but it's all there. 

I sometimes wonder if Basic 4.0 isn't a little too 
cosmetic. Users may forget (or never find out) that 
COLLECT is translated to V (for Verify), or that 
HEADER becomes N (for New). And perhaps they 
won't need to know such things — their computer 
will take care of it all for them. 

But dedicated users who plunge into the under- 
world of Machine Language programming will need 
to know these details. If they know the secret codes, 
they too can mix and match — but that's another 
story. ^ 



DIAL- A- ROM 

for the Commodore 
PET/CBM 

Switch between any one of six ROMs 

such as: 

■ WORDPRO from Professional Software 
Inc 

- VISICALC from Personal Software Inc 

- TOOLKIT from Palo Alto IC's 

- SORT from Matric Software Inc 

or switch charactersets with the Math 

and Foreign Language ROMs from West 

River Electronics (from KOBETEK in 

Canada). 

In attractive cabinet, with dipplug to fit 

into 24-pin socket. 

$88.00(03) 
(+ $5.00 airmail) 




h, 




kobetek 
systems 
limited 



JU*vJ 

RR Kl WOLFVILLE NOVA SCOTIA 
CANADA BOP 1 XO (902)542-9100 



"'^-y /v 




...being yr campleat 

catalogue of p«riphcrdl)» 

available for your P£T 






iJ/>^ Af^ 



Skylcs 

Electric 
t Works 



Skyles Electric Works 

231 E South Whisman Road 
Mounlain View, CA 94041 



FebruOfY, 1981- Issue 9- 



COMPUTE! 



109 



Memory 
Calendar 

Peter Spencer 
West Hill, Oratorio 

Have you ever forgotten an important date, anniver- 
sary, or payment deadline? Is there a i'amous person, 
say Charles Babbage or Jim Butterficld, whose birth- 
day you would like to remember? 



Memory Calendar lets you create a file of im- 
portant messages for each month of the year, and a 
Common file for messages that occur in all months. 
You can then print out a calendar (see Figure 1) for 
any month of any year. This printout will 
automatically incorporate the messages for the month 
you have selected, plus the Common messages if you 
wish, plus any specific one-time messages that you 
want to add. 

I have tried to make Memory Calendar as 
foolproof as possible, so that it can be used with ease 
by people who can type but who know little about 
computers. My intention was to write a useful utility 



MEMORV OFiLEHriRR 
M ^-r- ■== l-i 1 £•==■• 1 



SUNIiflV 



MOHIifli 



TUESDflV 



WEDHESriflV THURSDRV 



First Piatt 

successtu 1 flrfiendri'ient 

par"'achute riiai-<es 

•jumic- -frorri Cuba a. US 

.=fi'i fri'-ot^'ctor— 

■=f.i rp lane -ate 1 5y 1 . 
1912 



FRIDflV 



First 
-frozen 
-food so Id 
1 330 



SflTURDfl'' 



First 
esoala.tor 
patented 
1892 



mna 



»s£i 



First 
f:'as:seri-£ter 
rai 1 1.1." ay 
ser*-.'ice 

1S0? 



US '..-'otts 
to stay 
out of 
Le-a.'iiue of 
Hat i ons 
1920 



iir Is a.ac P e r s i -a 
Heu.iton ohai'isies 

died 1727 nairie to 

Irarf 1935 
First day 
ot st^'rinii 

mad 

Uesner 
patents 
kerosene 
1855 



Sarita. 

Rnna 

t.ai-ies 

h:'Otijer- in 

Mexico 

1323 



Crimeari 
War ended 
1856 




Figure 1. A typical Memory Calendar printout. 



no 



COMPUTE! 



Februory. 198! Issue 9, 



that would work for anyone. 

Writing a program that maintains and merges 
files is not that difiicuh, as most of Compute's 
readers know. The main problem I found in coding 
Memory Calendar was in the printout section, where 
each line of print must have pieces of as many as 
seven different messages in it, and each piece must 
hne up with the day it was intended for. 

If you would like a copy of the program (see 
Figure 2) without having to type it in yourself, send 
me a diskette and I will make you a copy of Memory 
Calendar for no charge. Hearing from other Com- 
pute readers has so far been a pleasure. 

Figure 2. Program Listing of Memory Calendar. 

10 CLR 

20 REM COPYRIGHT (C) 1980 BY P.T.SPENCE 

-iR. ALL RIGHTS RESERVED. 
30 REM COPY BUT DO NOT SELL 
40 REM P.T.SPENCER 
50 REM 7 BRIGHTSIDE DRIVE 
60 REM WEST HILL, ONTARIO 
70 REM CANADA HlE 3Y8 
80 REM (416) 281-1155 
90 REM 1980 12 14 
100 REM WRITTEN FOR BASIC 2.0 AND DOS -. 

-.1.0 
110 DEF FNFR{X)=PEEK(48) +256*PEEK ( 4 9 ) -. 

-.-(PEEK(46) +256*PEEK(47) ) 
120 PRINT"fi rMEMORY CALENDAR r mQ)_P.X.^ 

-■ SPENCER 19 80" 
130 POKE 59468, PEEK(59468)0R14 
140 DIM A$(42,9) 
150 OPEN 15,8,15 

160 PRINT'-^J-^HIT ANY KEY TO CONTINUE " ; 
170 GOSUB 1690 
180 : 

190 REM: INITIALIZATION 
200 N=0 
210 MK=1 
220 B$=" 

II 

230 Ml$="" 

240 DIM WD5{6) 

250 DATA"SUNDAY", "MONDAY", "TUESDAY", 

-."WEDNESDAY", "THURSDAY", "FRIDAY", 

-."SATURDAY" 
260 FOR J = TO 6 :READ V;D$(J) :NEXT J 
270 : 
280 PRINT"fixSfTART NEW FILE, OR xWfORK -. 

-.ON OLD FILE? "; 
290 GOSUB1690 

300 IF S$<>"W" AND S$<>"S" GOTO 280 
310 PRINT"^MAME OF MONTH (OR COMMON)"; : 

-.LL=10 :GOSUB2440 
320 AA$=IN? 
330 FOR 1=1 TO 13 
340 READ A3$,ND 
350 IF A3$=LEFT$(AA$,3) THEN MN=I : 

-.GOTO 3 90 
360 NEXT I 
370 DATA"J.AN",31, "FEB", 29, "aAR",31, 

-."APR", 30, "MAY", 31, "JUN", 30, "JUL", 

-.31 
380 DATA"AUG",31, "£EP",30, "QCT",31, 

-. "mv ",30, "DEC ",31, "COM ",31 
390 IFS?="W" THEN AC$=AA$ :GOTO 540 
400 : 



410 
420 
430 
440 



450 

460 
470 
480 
490 
500 
510 
520 
530 
540 
550 

560 

570 
580 
590 
600 
610 
620 

630 
640 
650 
660 
670 
680 

690 
700 

710 
720 

730 
740 
750 
760 
770 
780 

790 
800 
810 
820 

830 
840 
850 
860 
870 
880 
890 

900 
910 

920 
930 
940 
950 
960 
970 



PRINT"irSTARTING NEW FILEf" 

PRINT "ONE MOMENT PLEASE" 

FOR 1=1 TO 42 

A$ (1 , 1 ) = "j:_"+MID$ ( STR$ (I ) , 2 ) +RIGHTS ( 

-^" _r",9-LEN{MIDS(STR$(I) , 

-2))) 

REM WARNING***FIRST BLANK IN LINE -. 

-.ABOVE IS A CHR$(160) 
NEXT I 

F0RI=1 TO 42 
FOR J=2 TO 8 
A$(I,J)=CHR${160) 
NEXT J 
NEXT I 
GOTO1050 

REM: READ FROM DISK 
PRINT"^1NSERT DISK WITH ";AC$;" -. 

-.FILE "; 
PRINT" IN RIGHT DRIVE AND TYPE xGfO -. 

n"; :GOSUB 1690 
PRINT#15,"I0" 
FA$="0:" + AC$ + ",S,R" 
OPEN 5,8,2,FA$:GOSUB1750 
INPUT#5,ABS :RS=ST:GOSUB1750 
IF RSO0 THEN 850 
IF (AC$<>AB$) THEN PRINT"rFILE -, 

-.MISMATCH" :STOP 
FOR 1=1 TO ND 
FOR J=l TO 8 

INPUT#5,IN$ :RS=ST:GOSUB1750 
IP HK=1 THEN A$(I,J)=IN$ :GOTO 730 
G9% = 
IF LEFT$(INS,2) = "x"+CHR$(160) OR -. 

-.IN$=CHR$(160) GOTO 730 
FOR K=J TO 8 
IF AS{I,K)=CHRS(160) THEN A$(I, 

-.K)=IN$ :K=J+8 :G9%=1 
NEXT K 
IF G9% = THEN PRINT"xDAY" ; I ; "IS -. 

-.FULL — DISCARDEDr ";IN$ 
IF RS=64 THEN 820 
IF RSO0 THEN 850 
NEXT J 
NEXT I 
CLOSE 5 
IF MK=0 THEN PRINT"tHIT ANY KEY TO -. 

iCONTINUE "; : GOSUB 16 80 
MK=0 
GOTO1060 



PRINT"xEND OF DISK FILE" 

-.TO 1000: NEXT I 
CLOSE 5:GOTO1060 



;FOR 1=1 



PRINT"BAD DISK STATUS IS";RS 
CLOSE 5: CLOSE 15: STOP 

REM: SCROLL ROUTINE 
INPUT"i^DISPLAY ON PRINTER OR - 

-.SCREEN>>>S'f<<"; IN$ 
SN=3 :IF LEFT$(INS,1)="P" THEN SN=4 
IF SN=4 THEN PRINT"i^iSET UP PRINTER, 



^ THEN HIT ANY KEY " 
0PEN3,SN 
FOR DY=1 TO ND 
D1$=STR$(DY) 
PRINTft3,CHR?(l)+Dl$ 
FOR 1=2 TO 8 
IF A$(DY,I) <>CHR$(160) 

-.CHR$(17) + A$(DY,I) 



:GOSUB 1680 



THEN PRINT#3, 



February, 1981. issue 9. 



COMPUTE! 



Ill 



P 
I 

E 



PET/CBM* IEEE-i|88 TO PARALLEL PRINTERS 

THE P.I.E.-C IS C0J4PATIBLE WITH 
Centronics, NEC "Spinwriter" , Escon Products, AJ-841, 
IDS "Paper Tigers", Anadex, "MIPLOT" by Watanabe, etc. 

+ + + + !^**5|C )4! + + 3)C 

Fully assembled and attractively enclosed. Connected 
with, and powered by, the printer using the 6' data 
cable. Independently addressable as Device# 4 to 30. 
IEEE-488 Bus Extension for floppy disks, etc. Switch 
selectable PET-TO-ASCII code conversion. No software 
drivers required — Uses BASIC 488 commands instead. 
+ + + * + + ** + + +* 

ORDER TODAY -- ONLY $119.95 (+$5 S&H) (Md. Res. +TAX) 
Specify printer model plus PET model and ROM level 

LemData Products (301) 730-3257 

P.O. Box 1080, Columbia, Md. 21044 

"PET/CBM are trademarks of Commodore Business Machines 



P 



PFT SOFTWARE 

LAS VEGAS CASIKO SERIES: 

Tnfr5e*cur programs iherf-JK'.isiu^fJ both 15 a Iutcii*nQ([rii5T>?piA(ining Id ri^il a Ci-jiru^ana *ani[no lo Wiirfi la plajr co'Teclly «f"3 3^^ 
means tor iJie SBnous gamblei to deyel-op and IhprCujgNy Tci! * g<iiMiiin(j 5cs1p(t>' onaei ACIual CaSirva condiUDn^ All bel'mg tsl^^ afiJ 
opitons a.aiiabte ir> ihe Casino q( me WGM Grand Hold ifi L#t tfcfln^ ha^e twi-n iTicoiporaifrd .nln (rvese prugiarr& Full stree" gouriits 
ha*e twem used [t> sH'jw Ihe tiUs Stino desH, ItiO RoulOlle Wtw**! M'ln"'"!}, •"'J ""> Oit»< tofling ihiu«™ in ortfer lo incieaK leali^m *ia 
he>ch|en*n|ov"^*'''' 



1. C«ilnoBt*«I.J«cli^ 

For I lo 5 players plus Ilia iI^'jI*'' Knrpi Ifai:^ (il winnliQEtiT tones (on-iir 
•Dfi, lo-Sil. and ilvi] arid tTw Piurfib*ir ul limas Ifie deals' nnd p»i.Ti (.Uy.n -\\ 
dec''* Cmanoe dftChs or 'eshuttio al any nmo Spui i>-i'">, DomSiIif :)cjw. 
Full C*stnorul(>sand manir ofhc options 



2. CiStno nDu)et1«: 

Bet on Ofie number, Iwo njirbc'5. ofld, i 
Twetvewaystnbfl 



1. JsMcK.eic Watcfi Ihfr numt><:rs 



nt>iir< piLis piuinbcf ■;! nanda 
^ TiuMi-ii Play wiin 1. 3, or 4 
or place A>n IfisurAnce tJCt 



B jjjas irie wneci spin 



I CajLina alyle *"tl BlathiBt* nT^I'i iricludes ^pocla 



WUhDtiyCliiOdni, 



3. Casino Bacca(»t: 
Jarre^ Buitd^ Ta^oillc C*'"*' T«o gaiTins n 
teatjiUTi. !o litip in drrvcropir^Q 4 wirinino BiiMiti 

4. C»»lnoCrapt: 

BqI trie Dup !u Pa« or Faii Gil R«i trip Hjrd*, 

Tr'i^ wdysionei . 

5. CMinaPackt^: 

Aliinu' CBSirro Prugtains abQve ■ " .-■-- 

STRATEGIC GAMES: 

Pl3f Bail- grtfT'iTiO'-i JQ.ainjr ^«uf PIT CMMlterl QiApnc) »fi^ OflvUkiOQ gflllOP 

ma^prura rjslanijpiciiirggain* ... ..■ -■■ 

7. SPt'MNTIIlJiDMS JWIIHJOUIPI 

Wiillen br COUMODOf^f Jlkf AN Perlutms ai^clly Mxr Iho popul«' ■■dK *rc«il» Mrsion bfling played «ll 
ovcildecmjnl'y Ma'cniri*linQo3a*o'»pfiic*afiiIioi*idB''0«"JcnouftBl •niwtajfiment 
Pl«iS# specf, ftn.ci ROrJ wT yOur PtI ras 



Play 3flaifi« tn* PET PET pJay^ a flocxJ. I»sr o»m« iCt'OidiOi) lo Interritiotill Cfwcker Hu'm e«cell*fll 
aiaotiici snour the board »rd «ii cKecKer^s Witcr- vO^^r PET mo« hu nan arourd 1^ t»*rd Cl«k anows 
«iai9u<<1 iim* fw eacfi rrwYF 

Thii (s tri.w i].nwns<irt*i Thc T*c Tcm placed or fwji, ■* » < Upjia* PET piav« * '*« e-cihi^g n""^* 
chooi'rrg Diieol ir>f#«iifai«"i]i#i lor each gam* 



\o*, b*'oie your PfT A Cirl^ieriT 



ID. GqUoku: 

ani^ipiil Cr.>neH boaid gam» pray«d i>n • 9 ■ 9 U>ara C^t A r 
slTijIeST 1^5' eachgarre 

Enigi-in oairve h no*n ba Pev«rsi Try lo c»pluf* the PET 4 r»(n b«ioi* h» captuwi yeur^ fiav tsaifiti tr^e 
f ET or %gaiinKi your Iriends Fast *m lu" 

13. Crtbbaoa- 

An firi'llnril rtiswn pT |K>* f«>n«i|l! caid Qarri* All caitf« are ihown uainfl ^'"t tiC*!)*"*' praphicJ. 
ThcPEl playsaceo:n.H]if-alaaif*)FiJ.(liCiilMoi>**IP«er.t(Mllwb*iilpla'((i*» . . , 



n1.»Bd Id t» lietf 'pm pdpis *na to l(,ad O/i anj PET *ny dcTetlo^ lap*5 » 



OrderFrom CMS SOFTWARE, 5115 MenefeeDnve. Dalfas, TX 75277 



ted Itce 



V/S4' 



PETTERM 

INTELLIGENT 
TERMINAL 




INTELLIGENT 
DATA COMrHUN I CATIONS 



PETTERIVI 



PETTERrvl 



Turn your PET into an jntalligont 
terminal with on« of Our tarminal 
packages. Thesa ar* completa at* 
sernblfld hardware and lOftware 
packages. AM Include line editing/ 
resend, repeat key, ihift lock, out- 
put to CaM printer, and mora . . . 
Delivered on PET catsarte with 
n^anuali. Inquire for modem 
price*. 



All feature* above $75.00 

All feature* of L pEui local text editor 
with down-loading capability . . $90.00 



PETTERM III All faatura* of II, plut 80/132 column 
scrolling window for viewing formatted 
outputs wider then 40 columns. 
$100.00 






^^^-f-^\t*mr~^ -^o^- *rft^l I 0fn«»«j-t^.i"s 






S 


1983 Rio Ortram r.O- iox »4«3 

IVi.tln,T.MM l-3lJ-t7T-22»7 lVatln,T.«M 

797«S ?»712 


$ 


g 



112 



COMPUTE! 



February. 1981 Issue 9 



980 NEXT I 

990 PRINT#3 

1000 NEXT DY 

1010 PRINT#3 

1020 CLOSES 

1030 REM: DROPS THROUGH TO MENU 

1040 : 

1050 REM: MENU ROUTINE 

1060 PRINT"fi";B?;B?;B$ 

1070 PRINT "hiTfYPE, rCrHANGE, xPrRINT, 
II , 

"■ ; 

1080 PRINT "rMfEHORIZE, xDflSPLAY, 

-. xRfECALL COMMON FILE, rErXIT? " ; 
GOSUB1690 
IF S$="C" THEN M1$="C" : PRINT"fixCHA 

-.NGE^" :GOTO 1240 
IF S?="E" GOTO1630 
IF S$="T" THEN PRINT"fixTYPE^^" : 

■nCOTO 1240 
IF S$="M"GOTO1450 
IF S$="P"THEN1830 
IF S$="R" THEN AC$="£OMMON" ; 

-.GOTO540 
IF S$="D" THEN 1180 
GOTO106 
PRINT ^DISPLAY SINGLE xDrAY OR -. 

-.WHOLE xMfONTH? ";:GOSUB 1690 
IF S$="D" GOTO 2770 
IF S$="M" GOTO 880 
GOTO 1060 

REM TYPE ENTRY OR CHANGE ENTRY -. 

-.ROUTINE 
Z9$="" :LL=10 
PRINT "EACH MESSAGE CAN HAVE 7 -. 

-.LINES OF 10 CHARACTERS - 

-lEACH . " 
INPUT"t>HHICH DAY>>>*-^-*<";DY 
FOR 1=2 TO 8 
IF M1?<>"C" AND (A$(DY,I)=CHR$(160) 

-.OR A$CDY,I)="")THENN=I-1:I = 8 : 

-.GOTO1300 
PRINT I-1;A$(DY,I) 
NEXT I 
IF M1$="C" THEN INPUT"TYPE MESSAGE -. 

-.ON WHICH LINE»»1<<<";N 
PRINT"'^rTYPE NEW LINE OR LINESr" 
PRINT"liIT RETURN KEY TWICE TO -. 

^STOP.^" 
GOSUB 2630 :PRINTN,- 
GOSUB 2440 

IF IN$="" THEN PRINT"fi" :GOTO 2780 
A$(DY,N+1)=IN$ 
PRINT"! " 

PRINT"? ";N;A$(DY,N+1) 
IF H1$="C" THEN M1$="":PRINT"R" : 

-.GOTO 27 80 
N=N+1 

IP N>7 THEN PRINT"n" :GOTO 2780 
GOTO 1340 

REM: OUTPUT TO DISK 

INPUT"^OUTPUT TO DRIVE #>»»0<-f< " ; DD 
-.% 
1470 DD$=STRS(DD%) 

1480 PRINT"i^OUTPUT FILE NAME IS -. 
-■X";AA$;"r OK? " ; :GOSUB1690 
1490 IFSS<>"Y" GOTO 1060 
1500 PRINT#15,"I"+DD$ :GOSUB1750: 

-,FIS="@"+DD? + ": "+ AA$ +",S,W" 



1090 


1100 


1110 


1120 


1130 


1140 


1150 


1160 


1170 


1180 


1190 


1200 


1210 


1220 


1230 


1240 


1250 


1260 


1270 


1280 


1290 


1300 


1310 


1320 


1330 


1340 


1350 


1360 


1370 


1380 


1390 


1400 


1410 


1420 


1430 


1440 


1450 


1460 



1510 
1520 
1530 
1540 
1550 
1560 

1570 
1580 
1590 

1600 
1610 
1620 
1630 
1640 
1650 
1660 
1670 
1680 
1690 
1700 
1710 
1720 
1730 
1740 
1750 
1760 
1770 
1780 

1790 

1800 
1810 
1820 
1830 
1840 
1850 



OPEN 6,8,2,FI$ 

GOSUB1750 

PRINT#6,AA$;CHR${13) ; :GOSUB 1750 

FOR 1=1 TO ND 

FOR J=l TO 8 

PRINT#6,A$(I, J) ;CHR$(13) ; :GOSUB -. 

-.1750 
NEXT J 
NEXT I 
PRINT#6,"END OF FILE" ; CHR$ [ 13 ) ; : 

-.GOSUB1750 
CL0SE6 

PRINT"DRIVE ";DDS;" HAS ";AA$ 
GOTO 1060 

PRINT"^^XSHUT DOWN? ";:GOSUB1690 
IF S$="N" GOTO 1060 
CLOSE 15 
END 



REM: GET SUBROUTINE 

POKE167,0 

GETS$:IFS$=""THEN1690 

PRINTS? 

P0KE167,1 

RETURN 

REM: READ ERROR CHANNEL 
INPUT#15,EN$,EM$,ET$,ES$ 
IF EN$="00" THEN RETURN 
PRINT"DISK ERROR #"EN$" "EM$" -. 

-."ET$" "ES? 
INPUT" CONTINUE? >»N-«-*-* " ; IN$ : 

-.IF IN$="Y"THEN RETURN 
CLOSE 5: CLOSE 6:CL0SE15 
END 

REM: OUTPUT TO PRINTER 
PRINT"txPRINTING ENDS THE PROGRAM" 
1NPUT"HAVE YOU MEMORIZED FILE -. 

^FIRST?»>>*«<";SS: IF LEFT$ (S$, 

^1)<>"Y"THEN1060 
1860 INPUT"\^ENTER YEAR (EG 1981 ) »>*4<'« " 

-.;YR 
1870 REM IF FEB NOT IN LEAP YR,ND=28 
1880 IF YR/400=INT(YR/400) GOTO 1910 
1890 IF (YR/100=INT(yR/100) )AND MN=2 -. 

-.THEN ND=28 :GOTO 1910 
1900 IF (YR/4<>INT(YR/4) )AND HN=2 THEN -. 

-.ND=28 
1910 GOSUB 2670 
1920 PRINT"^xGET PRINTER READY, THEN -. 

-.HIT ANY KEY " ; :GOSUB1690 
1930 OPEN 3,4 

1940 PRINT#3:PRINT#3:PRINT#3:PRINT#3 
1950 PRINT#3,CHR$(1)+" 

-.MEMORY CALENDAR" 
1960 LZ=INT( (40-LEN(AA$+STR$(YR) ) )/2} 
1970 A7$="" 
1980 FOR 1=1 TO LZ 
1990 A7$=A7$+" " 
2000 NEXT I 
2010 PRINT#3,CHR$(17)+CHR$(1)+A7?+AA$ -. 

-.+ STR$(YR) 
2020 PRINT#3:PR1NT*3:PRINT#3 
2030 CLOSE 3 
2040 FM$="AAAAAAAAAA " 
2050 FT$="" 
2060 FOR 1=1 TO 7 
2070 FT$=FT$+FM$ 
2080 NEXT I 



February, 1981 Issue 9, 



COMPUTE 



113 



2090 
2100 
2110 
2120 
2130 
2140 
2150 
2160 
2170 
2180 
2190 
2200 
2210 
2220 
2230 
2240 
2250 
2260 
2270 
2280 
2290 
2300 
2310 

2320 
2330 
2340 
2350 
2360 
2370 
2380 
2390 
2400 
2410 
2420 
2430 
2440 

2450 
2460 
2470 
2480 

2490 

2500 
2510 



2520 
2530 

2540 
2550 

2560 
2570 

2580 
2590 
2600 
2610 
2620 
2630 

2640 



2650 
2660 



OPEN3,4,2 

PRINT#3,FT$ 

CL0SE3 

OPEN3,4,l 
FOR 1=0 TO 6 

PRINT#3,WD$(I) ;CHR${29) ; 
NEXT I 
PRINT#3 

IF WD=0 GOTO 2280 
FOR I=ND TO 1 STEP -1 
FOR J=l TO 8 
A$(I+WD,J)=A$(I,J) 
A$(I,J)=CHRS(160) 
NEXT J 
NEXT I 
ND=ND+WD 

FOR 1=1 TO 36 STEP 7 

FOR J=l TO 8 

FOR K=I TO 1+6 

IF K>ND THEN PRINT#3 ,CHR$ (160) ; CHR? 

^(29) ; :GOTO 2330 
PRINT#3,CHR$(17) +A$(K,J) ;CHR$(29) ; 
NEXT K 
PRINT#3 
NEXT J 
NEXT I 

PRINT#3 
CLOSE 3 

PRINT"Rt^t^xFINISHED" 
GOTO 1650 :REM END PROGRAM 

REM INPUT SUBROUTINE 
IN?="":IFZ9$<>""THENPRINT"? ";Z9$; : 

-,POKE167,0:INS=Z9$:29$="":GOTO24 60 
PRINT"? "; :POKE167,0 
GETZ?:IFZ$=""THEN2460 
IF Z$=" " THEN Z$=CHR$(160) 
IFZ$=CHR?(13) OR Z$=CHRS(141) -. 

-iTHENPRINT" ": POKE167 , 1 : RETURN 
IFZ?=CHR${20)THENONSGN{LEN(IN$) ) +1G 

-,OTO2460,2550 
Z8=ASC(Z$) 
IF Z8=44 OR Z8 = 58 OR Z8=22 THEN -. 

',Z$="" :REM ELIMINATE DISK-PRINTER 

-.TROUBLES 
PRINTZ$; :IN$=IN$+Z$ 
IFLEN(IN$) >=LLTHENGOSUB2560: 

-.PRINT" ":POKE167,l: RETURN 
GOTO2460 
PRINTZ$;:IK$=MID${IN$,1,LEN(IN?)-1) 

-.:GOTO2460 
F0RZ9=LEN ( IN$) TOlSTEP-1 
IF (MID$(IN$,Z9,1)<>" ")AND(MID$(IN 

-,S,Z9,1) <>CHR$(160) ) GOTO 2610 
Z9$=RIGHT${IN$,LEN{IN$}-Z9) 
IN$=LEFTS(IN$,Z9-1) 
Z9 = l 
NEXTZ9 :RETURN 

REM: TEST IF GARBAGE COLLECTION -. 

-.NECESSARY 
IF FNFR(X) < (LL*LL)/2 THEN -. 

-.PRINT "^ZONE MOMENT PLEASEr": 

-. Q=FRE(0) 
RETURN 



2670 
2680 
2690 
2700 
2710 
2720 

2730 
2740 
2750 
2760 
2770 
2780 
2790 
2800 
2810 
2820 
2830 
2840 
2850 



REM FIND WHAT DAY OF WEEK FIRST IS 

CY=YR :MP=MN-2 

IF MP<1 THEN MP=MP+12 :CY=CY-1 

YY=CY-INT(CY/100) *100 

CC=INT(CY/100) 
WD=YY+INTCYY/4)+INT(CC/4)-2*CC+l+IN 

-,T(2.6*MP-.1999) 
WD=WD- INT {WD/7) *7 
RETURN 

REM DISPLAY DAY ROUTINE 
INPUT"^^DISPLAY WHICH DAY";DY 

PRINT" ";A$(DY,1} 

FOR 1=2 TO 8 

PRINT I-1;A$(DY,I) 

NEXT I 

PRINT"i^HIT ANY KEY TO CONTINUE "; 

GOSUB 1690 

GOTO 1050 




Money Back Guarantee 



Dealer Inquiries Welcorrie 



New 248-page book includes all the former TIS workbooks 
except "PET Graphics." Provides inforrnatlon tor both ROMs and 
a comprehensive index. Only SI'l.SS. 



Alio Irom TIS 
WB-3 PET Grapriics 



S4 95 



Soiiware products on cassGtte or floppy disk with complete instruclion 
manual Each S24 95 Icassette). SZ9 95 (diskette} 

SW-1 MAIL B mailing list system 

SW-2 CHECKBOOK record 

SW-3 ACCOUNTS heep track o( who owes you liow mucn 

SW-J MEDIT create and maintain dale liles 

SW-5 CALENDAR appointments, meetings at-a-glance 

TiS 

PO Bo« 921. Dept. C Add S2 |S5 loreign orders) 

Los Alamos, NM 87544 "^'^^'"9 '"" ''""'"'"9 

PI I .iir! I!IV ..,,. [r.ir...inirhs ul Ciirii.i....,]i » n Bw :Si M,irJ-in.?s 



H4 



COMPUTE! 



February. 1981 Issue 9 



Crash 
Prevention 
For The Pet 



Elizabeth Deal 
Malvern, Po. 

This article is for beginners in machine code pro- 
gramming and for those who use machine code 
subroutines from various sources. It describes several 
reasons for crashes and how to avoid doing things 
that make it crash. It is geared mostly to the owners 
of the upgrade-ROM Pets (Basic 3.0), but some 
ideas should be useful to all Pet owners. 

I define a "crash" as a situation where all con- 
trol over the Pet is lost. It is an error condition of 
such severity that the cursor disappears, the 
keyboard does not work and you have to pull the 
plug. I also include in the definition of a crash a 
symptom of Pet behaving "silly", when, for 
instance, simple commands, like LIST or RUN lead 
to SYNTAX ERROR condition or a display of 
monitor registers. 

I have heard people imply that these crashes are 
caused by a defect in the Pet. It is my experience 
that the overwhelming majority of such crashes are 
due to a defect in programming. 

Let me illustrate some crashes by working in 
BASIC. These simple illustrations will show what 
can go wrong and why. 

(1) Type WAIT 0,1. Since location always con- 
tains 76 the Pet is made to wait forever for a 1 . The 
stop key doesn't work while the Pet is waiting. You 
can now turn the Pet off and on or use the Butter- 
field procedure to regain control. (I strongly 
recommend that you build or buy an uncrashing 
device - Compute #1, p. 89). 

(2) Type in or load a very short program, two or 
three lines is enough. Now POKE41,7, and type 
RUN. You'll get SYNTAX ERROR. Type LIST 
and you'll get garbage. POKE 41,4 and all will be 
well again. 

Such errors, as silly as they look, are very easy 
to make, even in Basic. If your variables are unde- 
fined, if you failed to add a constant to some 
address, etc. you will crash. 

(3) Type POKE 81,15. Any value different from 76 
will do. Now type PRINT PEEK(81) or PRINT 
FRE(O). The register display in this case tells you 
where the break occurred and that the Pet doesn't 
know where to go. Locations 81-83 contain a jump 
instruction to evaluate functions. Poking wrong 
values into 81-83 destroys Pet's ability to handle 



functions of which PEEK and FRE are just two 
examples. The Pet is alive at this moment and so 
long as you use no functions everything will work 
quite well. If you do use functions you will not 
recover from this sort of a crash even by the Butter- 
field procedure which preserves memory. Either 
power off or type POKE 81,76 to get things back to 
normal. 

(4) Type FORJ = 112 TO 118:POKE J,42:NEXT. 

The Pet is gone. Reset by the Butterfield procedure. 
The Pet will work in the monitor mode but not in 
BASIC mode. You can save the program that caused 
such a crash using the monitor. But if you exit the 
monitor by "X" and give a BASIC instruction, like 
LIST, the Pet will crash again. The only solution is 
to pull the plug. The reason is that locations 112-118 
are one of many vital links between the monitor and 
BASIC. Destroying the contents of 112-118 destroyed 
Pet's ability to understand BASIC altogether. It is 
possible to regain BASIC using a method written by 
Robert Lando and shown to me by Mr. Wachtel. 
This method consists of copying the entire contents 
of the ROM CHRGET routine to locations 112-135 
immediately after changing the SP value in the 
Butterfield procedure (hex: from $E0F9-$En0 to 
$70-S87). 

I am grateful to Jim Butterfield for showing me 
those locations that are crucial for supporting 
BASIC. If the contents of these location are 
disturbed in any way, only restarting the Pet will 
allow you to regain control. They are, in decimal, 
USR vector (0-2), various indicators (13-15), string 
descriptors (19-21), start of BASIC program (40-41), 
top of the PET (52-53), garbage yardstick (80), and 
jump vector for functions (81-83). Further, interrupt 
system at 144-145, CHRGET routine at 112-135 and 
location 1024 which must be zero for BASIC to run 
from its normal position. If the CMD command is 
on all output goes elsewhere thus you can't 
communicate with the Pel. This list shows the most 
important locations. There are many others that if 
disturbed will cause unrecoverable crashes. Note 
again, that the Butterfield procedure will let you see 
what went wrong and permit you to save the 
offending program. But to be able to use BASIC 
commands you may have to reset the Pet completely. 

As you can clearly see, we caused a lot of 
trouble without ever leaving BASIC. When you work 
with machine code, the most frequent reasons for 
crashing will be of the WAIT variety, jumping or 
branching to wrong locations and infinite loops. You 
vvill recover by the Butterfield procedure and prevent 
further crashes by fixing the code. 

But how can you prevent the hard crashes 
described above? I have run into a lot of such trouble 
while trying to adapt machine code subroutines 
written for an old Pet to my "new" Pet, often 
without knowing for which Pet the code was written. 
The most notorious offenders were those routines 



February, 1961 Issue 9 



COMPUTE! 



115 



Professional Business Software 

For The Commodore 32K Microcomputer System 
With 2040 Dual Drive Disk & 2022 Tractor Feed Printer 




General Ledger 



Accounts Payable 



Accounts Receivable 



Payroll 



Holds Up To 300 Accounts, 

Accepts Up To 3000 
Trarisactiofts Per Month. 
Cash Disbursements Journal, 
Cast! Receipts Journal, and 
Petty Casli Journal for 
simplified data entry- 
Maintains Account Balances 
For Present Month, Preseni 
Quarter, Present Year, Tliree 
Previous Ouarlers. And 
Previous Year 

Complete Financial Reports 
Including Trial Balance, 
Balance Sheet, Profit & Loss 
Statement, Cash Receipts 
Journal, Cash Disbursements 
Journal, Petty Cash Journal 
and more 

Accepts Postings From 
External Sources Such As 
Accounts Payable, Accounts 
Receivable, l^ayroll. 
Etc 



• Interactive Data Entry With 
Veriiied Input And Complete 
Operator Prompting, 

• Automatic Application Of 
Credit And Debit Memos 

• Maintains Complete Purchase 
Records For Up To 200 
Vendors. 

• Invoice File Accepts Up To 
400 Invoices, 

• Random Access File 
Organization Allows Fast 
Individual Record Updating 

• Multiple Reports Provide A 
Complete Audit Trail, 

• Check Printing With Full 
Invoice Detail. 

• Full Invoice Aging 

• Automatic Posting To 
General Ledger 



Maintains Invoice File For Up 
To 300 Invoices. 

Accomodates Full Or Partial 
invoice Payments 

Customer File Maintains 
Purchase Information For Up 
To 1000 Customers. 

Allows For Automatic 
Progress Billing 

Provides For Credit And Debit 
Memos As Well As Invoices 

Prints Individualized 
Customer Statements 

Interactive Data Entry With 
FullOperalor Prompting. 

Complete Data Input 
Verification And Formating 

Automatic Posting To 
General Ledger 



Maintains Monthfy, Quarterly, 
And Yearly Cumulative Totals 
For Each Employee, 

Payroll Check Printing With 
Full Deduction And Pay Detail. 

Sixteen DifferenI Reports 
Including W2 And 941. 

I Interactive Data Entry With 
Easy Correction Of Entry 
Errors. 

t Automatic Data Verification, 

* Complete Job Costing Option 
With Cumulative Totals And 
Overhead Calculations. 

• Random Access File 
Organization For Fast 
Updating Of Individual 
Records. 

> Automatic Posting To 
General Ledger . . , 



Structured around tfre time tested and reliability proven 
series of business software systems developed by Osborne 
and Associates, these programs have been designed to (ill 
the need of a comprehensive accounting package for the 
new Commodore PET micro computer system. Each program 
can either stand alone, or be integrated with the others in a 
total software system 

Designed with the first lime user in mind, these programs 
lead Itie operator througti step by step, verified data entry It 
IS impossible to 'crash' a program due to operator error or 
invalid data input. Design consistency has been maintained 
from program to program to greatly increase operator 
familiarity and confidence. 

Documenlation, normally a problem for small systems 
users, IS provided by the comprehensive series of Osborne 



and Associates user manuals These three manuals together 
total over 800 pages of detailed step by step instructions 
written at three levels lor DP Department Managers, Data 
Entry Operators, and Programmers Vou don't have to worry 
about getting 'promises' instead of documentation because 
the documentation was written before the programs 
were developed A second set of manuals details any 
changes required during conversion. Each program 
provided on disk witfi complete documentation Packaged 
in a handsome three ring binder with pockets and twelve 
monttily dividers for convenient storage of reports 

See your nearest Commodore dealer tor a demonstra- 
tion of this outstanding business software system. 



CMS Software Systems 



5t 15 MEI^EFEE DRIVE 



DAI IAS TX 75??7 



214 381 0690 



m 



COMPUTE! 



February. 1981. Issue 9 



that used the old Pet's input buffer (locations 10-89) 
for storage of variables and addresses. You can see 
that some of the most important locations in the new 
Pet are where the old Pet's input buffer is. 

Many of the old Pet routines can be changed to 
run, without crashing, on the new Pet, if you're 
careful. Many of them do not use any BASIC ROM 
routines, thus we do not have to bother with that 
translation. Most of them use zero page addressing 
and use iocations 10-89. It's a good idea to learn just 
enough about the machine code instructions of the 
Pet to be able to spot the addresses. You can then 
find locations in the new Pet that are safe and 
change the program accordingly. Some locations I 
think are safe are 1-2 if main program has no USR 
call, 15-16, 84-89, 60-63 if you're not using DATA 
lines in the main program, 177-195 if (ape is not 
used, And there are others. When a large block of 
contiguous locations is needed and 177-195 cannot be 
used, you will have to redo some of the coding in the 
following way. Determine the zero-page locations you 
need, and how many. Attach a bit of code at the 
beginning of a machine code routine to move the 
contents of the locations you're interested in into the 
first cassette buffer. Just prior to exit from the 
subroutine, move the contents back from the cassette 
buffer to page zero. When control returns to BASIC 
nothing has been disturbed and the Pet cannot crash. 
Please note that inserting more code may require 
some changes in absolute addresses in the routine 
itself. This is not difficult to do. 



We have now taken care of those problems 
where machine code routines can destroy important 
Pet pointers, BASIC connection and so on. But there 
is another problem, that of strings from the BASIC 
program destroying machine code rou lines placed at 
the top of the Pet. Michael Riley gave me a simple 
solution: after poking the appropriate top of the Pet 
pointers (52-53) h is necessary to either say CLR or 
RUN-next line for all pointers to be set. So if your 
machine code routine does not perform this opera- 
tion, you can do it in direct mode or within the 
BASIC program. Just make sure you do not initialize 
any variables needed by the program before the CLR 
or RUN line. 

1 find it helpful to go over a routine looking for 
what might cause the Pet to crash and how to pre- 
vent it. Some routines work only with a main pro- 
gram they were designed for. They may not work for 
your calling program because of different BASIC 
commands you may use (see point 3 above). Adjust 
them, so they are as general as possible and you'll 
never have to worry about crashing, no matter what 
the calling program contains. There are many very 
useful routines in the press that are worth the trouble 
of conversion. The side benefit of making changes in 
well written programs you sec in the magazines is 
that you can learn a lot from them. I did. 
References: 
I.Jim Butterfield, Compute and personal communication 

2. Michael Riley, personal tommunication 

3. Nick Hampshire, The Pet Revealed, Conifjutabits, England 

4. Anselm Wachtcl, Coil)putc#2 and personal communication, i 



Machine 
Language 
Printer 
Command 



Zoltan Szepesi 
Pittsburgh, PA 



While working on a Machine Language program, it 
could be advantageous to be able to give a command 
to the printer in ML instead of going back to BASIC 
and returning to the Monitor or to some other ML 
program. 

The program, which follows, substitutes the 
BASIC command: 
OPEN4,4:CMD4 

and at the end: 
PRINT #4:CLOSE4 



The program can be loaded anywhere there are 
20 bytes free address. Starting at $XXXX: 
xxxx 

START A9 04 LDA -$04 File and 

device number 

85 BO STA zSBO The out- 
put to CMD is in SBO 

85 D4 STA z$D4 The 

device number is in 
SD4 

20 BA 

FO JSR OPEN IEEE 

20 2D 

Fl JSR TEST IEEE 

20 D2 

FF JSR WRT 

00 BRK 

XX(X + 1)X 4C CC 

FF JMP RESTORE I/O 

00 BRK 

When we want to start the printer, we have to type: 
.0 XXXX (or working with some other program, 
e.g. Moser's Assembler, print: RUN $XXXX), and 
to close the printer we have to type: .0 XX(X + 1)X, 

The screen does not show what the printer 
prints, but we can give the necessary commands 
through the keyboard as if the printed text would be 
on the screen. This way we can continually print out 
the dumping of a complete ML program or the 
Assmelbe List. ^ 



February, 1981. Issue 9 



COMPUTE! 



117 



PET' MACHINE LANGUAGE GUIDE 





PIT 






MaCHiNt 






LANGUAC.f 






GlJIDi 

£1) 




A 


i^^f' 


1 


S 


^'^^^ 


^ 









c:ontenli include sfi.tions om 

• inpul and output r outinf^i, 

• I iKcd point, floating point, 
flnd Ascii number convnrsion- 

•ciocks and timers. 

• BuiH-m ariltMiiGtic lunctions. 

• t'rrjgraniming 111 nl 5 and Siigqes- 
tions. 

•iviany iamplo proyrarriv. 

VJhile supply lasts: 

Guides for Old ROMS 

only S5.00 inc poslage 

New ROfvIS order below 



H you are interested in or are already into machine langii.ige 
programming on the PET, then this invaluable guitJe is for 
you. More than 30 of the PET's buitt in routines are fully 
detailed so that the reader can immediately put them to good 
use. 

Available for $6.95 + .75 postage. Michigan residents please 
include 4% stale sales tax. VISA and Mastercharge cards 
accepted ■ give card number and expiration date. Quantity 
discounts are available. 



illliiilii 



ABACUS SOFTWARE 

P. 0. Box 7211 

Grand Rapids, Michigan 



49510 



Microphys is pleased to release a se;ies ol Anagram programs deikjned for 
use in both a recreational and educational selling. Employing a game for- 
mat, each program randomly generates large-type anagrams which ait to 
be deciphered. Points are awarded for correct solutions and clues may be 
displayed when difficulty is encountered. One tries to interpret as many 
anagrams as possible within the allotted time which is also displayed on the 
computer screen. 

Match play may be established since the computer may be directed to 
generate the same seqjence of anagrams for two or more players. The time 
interval may also be adjusted in order to compensate for age or intelligence 
differences. 

The Anagram programs are available in five "level of-difficulty" 
categories. The clues provided in the school and college categories are 
generally defir:itive in nature. Thus, vocabulary, reeding, and spelling skills 
are reinforced by these programs, i^any of the words used are found in the 
Microphys vocabulary and spelling series for the corresponding grade 
levels. 

The programs are intended lor use with a Commodore PET/CBM 
miciocompuler having at least 8H of storage. Each program is recorded on 
a C-10 cassette and is accompanied by simple descriptive instructions. The 
programs retail for $15 each. 
PCSJO Anagrams I Recreational 1 
PC34I Anagrams II Recretional 2 
PC342 Anagrams 111 College I 
PC343 Anagrams IV ColleHe 2 
PC3d4 Anagianis V ffigh School I 
PC345 Anagrams VI High School 2 
PC346 Anagrams VII Junior High 1 
PC347 Anagrams VIII Junior High 2 
PC348 Anagrams IX Elementary 1 
PC3d9 Anagrams X Elementary 2 

A recreational'edLcational diskette is also available for use with the Com 
modore 2040 disk drive. In addition to the above 10 programs, this diskette 
contains the six Microphys "Wheel of Fortune" word games (see PC375- 
PC380 in our Fall 1980 catalog) as well as PC350 Crypio, PC385 Poker, 
end PC390 Bingo. This diskette is accompanied by complete insliuctions 
for each program and retails for S160 

Educators: Be certain to write for our free educational software catalog 
which lists over 160 programs for use in introductory courses in chemistry, 
physics, calculus, junior and senior high math, vocabularly. and spelling. 



2048 Kord St. 



Dealer Inquires Invited 

MICROPHYS PROGRAMS 

Bklyn.N.Y. 11229 

(212) 646-0140 



P r jRoiM^eiriiiM PET Products 

from 

OPTIMIZED DATA SYSTEHISl 

-SOFTWARE FOR ALL PET/CBMs- 
(Supplied on Cassette-Prices include Shipping! 

• WORD PROCESSOR (PS-ODU S16,95 

fWakei documents a snap 

• MAILING LIST {PS-002) S16,95 

Throw avtfay your address book 

• SPACE EATER (PS-0031 S9.95 

Gobbles spaces in BASIC program! 

• CATALOG (PS-004) S16,95 

File stamp/coin/etc, collections 

• SATELLITE TRACKER IPS-a05l S24.95 

Tracks OSCAR Ham Satellite in real time 

• MORSE CODE KEYER IPS-OQSI $14.95 

,^ Sends code on the air or for practice 

^» MINI-COUNT^ " IPS-0071 519,95 

MeasLires frequency to 17KHz and intervals to 65 msec 

-HARDWARE FOR "OLD" 8K PETS- 
(Shipping Additional) 

• 2114 RAM ADAPTER 1+ S1.50 per order) 

Replaces up to 8-65&0S with low mit, reliable 2114s 



.S8.96 



PHK-001 IKit-2 sockets) , 
PHK-OGIS IKit-e iocketsl 



SI 3,95 
SI 6.25 



PHB 001 (Bare PCBI . . 
PH001S lAssm-sockets 

only) S22.95 

PH-001 IA5sm^2 sockets -tone 21 141 S24.9S 

.i^» 4K MEMORY EXPANSION (+ S3 per order) 

Installs easily internally. Uses 21 14s, Write Protect, 



PHB-002 [Bare PCB) , . 

PH.0Q2S lAssm-sockets 

only) 



.SI 6 
.842 



PHK-002 IKit-sockets only! S29 

PH002 (Full Assm) $105 



PROMPT SHIPMENT! 
Calif. Resitlents, add 6% Tax 

P,0. Box 59B, Dept. C 



SATISFACTION GUARANTEED 
■ Placentia, California 92670 



fVllNl-COUNT Trademark of Optimi/wl Data Svsmrnj 
F*ET>C8M Trad&mark of C^mmadorB Business MachiiiBS 



Computer House Division 

PROGRAMS FOR COMMODORE AND APPLE 

Legal accounting Demo $15,00 

Legal accounting Program 995.00 

Mactiine Part Quote Demo 15.00 

Mactnine Part Quote Program 325.00 

Mailing/phone list 80.00 

Political Mail/phone list 130.00 

Beams, structural 115,00 

Trig/Circle Tangent 110,00 

Spur Gears 35.00 

Bolt Circles 25.00 

Filament Wound TAnks 125,00 

Scrunch 25.00 

PROGRAMS FOR COMMODORE ONLY 

A/P,A/R, Job Cost & Job Est, 370,00 

Inventory 95,00 

Financial 175,00 

Real Estate Listings 265.00 

Ctieck Writer 25,00 

File Editing Tools (FET) 65,00 

Screen Dump/Repeat 35.00 

Docu-Print 20,00 

Scruncti 25.00 

Sof-Bkup 'iO.OO 

Sorter (Macti, Language) 35,00 

Trace-Print 25,00 

Vari-Print 25,00 



ASK FOR CATALOG #80-C2 Dealers Wante(j 
Computer House Div. 1407 Clinton Road 
Jackson, Michigan 49202 (517) 782-2132 



118 



COMPUTE! 



February. 1981 Issue 9 



ODDS & ENDS 

ON PET/CBM files 

Jim Butterfield 

Writing data to a file is quite straightforward: OPEN 
the file, PRINT# to the file as many times as you 
like, and then CLOSE the file. Reading is pretty 
easy, too: OPEN the file, INPUTS until the file has 
given you all its data, and CLOSE the file. 

You can also read a file by using GET# instead of 
INPUT#. The GET# command is especially u.seful 
for checking out a file and seeing what's on there. 
Here's why: INPUT reads everything to the cnd-of- 
line; trims the line it has received by taking off 
leading and trailing spaces and quotation marks, and 
then scans the line, converting numbers to internal 
representation, etc. All very handy; but if something 
goes wrong, you'll want to use GET to look at the 
characters one at a time. 

When you're reading a data file, keep watching 
variable ST. It will normally be zero; at the time you 
read the last value it will change to a value of 64, 
Any other value means you have a read error. 

The ST indicator works slightly differently on the 
original PET ROMs. It does not go to 64 at the time 
you read the last value; instead, it switches to 64 
only when you try for the following value — the one 
that isn't there. You can handle this with careful 
coding. But you'll be better off to upgrade your 
ROM set so that your programs will be compatible 
with newer machines. 

End-of-file on a disk read is shown in ST, but errors 
are not. On upgrade (2.0) ROMs, use the command 
channel (Secondary Address 15) to ask the disk unit 
how it's doing. Newer ROMs give you disk status 
variables called DS and DS$ to make it easy to check 
errors. 

PRINT# sends to a file in almost exactly the same 
way that PRINT sends to the screen: as a group of 
ASCII type characters. INPUT# receives from a file 
the same way that INPUT receives from the 
keyboard/.screcn. Make sure that what you send to a 
file will be seen as a good input when it comes back. 

Let's pick up more detail on the previous item. If X 
is five and Y is two, and you say PRINT#3,X;Y the 
file will be written as: 

(space) 3 (space) (space) 2 (space) (return) 

Think about it. What would happen if you typed the 



above sequence in response to an INPUT? Answer: 
PET would sec a single number — not two — whose 
value is 32. That's exactly what would happen if you 
later tried to read with an INPUT#. Solution: say 
PRINT#3,X : PRINT#3,Y and the two numbers 
will be neatly separated with a RETURN character. 



For exactly the same reasons. You shouldn't say 
PRINT#3,X,Y . . . you'll put more spaces on the file, 
but you won't solve the problem. 

Best practice: Use a separate PRINT# statement 
for each variable. 



Early PETs — everything before ROM 4.0 — write 
both RETURN and LINEFEED at the end of a 
line. The RETURN is handy — in fact, it's vital — 
but the LINEFEED can give trouble and should be 
taken out. You do this by coding something like: 
PRINT#3,X;CHR$(13); 

The CHR$(13) is the RETURN character. Don't 
forget the semicolon at the end, or PET will stick 
another RETURN and LINEFEED behind the 
whole thing and you'll have a mess. 

On 4.0 and subsequent ROMs, the LINEFEED will 
normally be supressed, and you can go back to 
PRINT#3,X. Cassette tape files have a special 
feature which avoids writing the LINEFEED 
character. 

Programs using cassette tape files are quite easy to 
convert to disk. To open a file for writing change, for 
example, OPEN 1,1,1, "INVENTORY" to OPEN 
1,8,3, "0: INVENTORY, S,W". The 8 means device 
8, usually disk; the 3 is an internal disk channel 
number (pick anything from 3 to 14); 0: means drive 
zero, and ,S,W means we plan to Write a Sequential 
file. Everything else for writing the file can remain as 
before (PRINT* and CLOSE), so long as you watch 
to make sure you don't write LINEFEEDS with your 
PRINT#. 

Switching over to disk for reading a file is even 
easier. Change OPEN 1,1,0, "FILENAME" to 
OPEN 1,8,3, "FILENAME" and you're in business. 



In cutting over from tape to disk files, it doesn't hurl 
to add error checking, of course — secondary address 
15 or variables DS and DS$, depending on your 
system. 



February. 1981 issue 9 



COMPUTE! 



119 



Never use the TAB function in writing to a file — or 
to the printer, for that matter. PET will try to 
calculate the proper place on the screen for the infor- 
mation — and then sends that type of information to 
the file. It almost invariably botches the job. 

Make sure that any file you write is always closed 
properly. It's all too easy to write a program that 
stops or goes into a special routine in certain cases — 
leaving a file open forever. 

Get into the habit of protective CLOSE 
statements. It's perfectly allowable to say CLOSE 1 
even if you're not sure that file number 1 was ever 
opened. And it doesn't hurt. 

Don't forget that you can use a variable to indicate 
the logical address you want to use. You can say, 
PRINT#J. . .and if J is one, you'll send to logical 
device number one, etc. This is a very effective way 
to split a file into several smaller files. 

Remember, too, that you can open the screen as 
a file (it's device 3), so that you could send some 
things to the screen and others to disk. © 



ROM 

OR ON 

CASSETTE 



THE PET RABBIT 



4,0 

OR 

3.0 ROMS 



The PET Rabbit is a programmers aid which provides 1 2 addition- 
al commands thai can be executed in BASIC'S direct mode. In 
addition to the commands, automatic repeat of any key held down 
for 5 seconds is also prouided. This will greatly aid inputtings 
of characters and provide more convenient cursor control. Most 
importantly, the RABBlTs high speed recording lechnique allows 
an BK program to be saved in 38 seconds instead of the normal 2 
minutes and 44 seconds in Commodore's format. (Note— The 
RABBIT cannot be used to store data tapes from BASIC.) 
The PET Rabbit is 2K of machine code su!9plicd on cassette or in 
ROM. The cassette version occupies the tap-most portion of 
memory and can be ordered in one of 5 locations: $1 800-$l FFF 
for 8K PETS, SSOOO-Sa^FF or $3a00-$3FFF for 16K PETS, and 
$7aaO-$77FF or $7800-$7FFF for 32K PETs. The reason for 
two different versions for the 16K and 32K PETs Is to provide 
room for those programmers who use the DOS Support (wedge) 
program. (Note— The cassette RABBIT works only with 3.0 

ROM PET'S.) 

The ROM version is a 24 pin Integrated Circuit which plugs into 
spare socket D4 and occupies memory $A00O-$A7FF. Since the 
ROM version does not occupy user RAM, it will work with any 
8K 1 6K, or 32 K 3.0 or 4.0 ROM PET. The main advantage of 
the ROM Rabbit is that it doesn't have to be loaded each tjme 
you power up your PET and it does not occupy valuable RAM 
memory. 

The PET RABBITS high-speed cassette recording feature will not 
work with some of Commodore's older cassette decks. To be 
specific, cassette decks with the lift lop lid (termed old slyie) 
will not work but all other features will work. In addition, we 
have discovered that some new style cassette decks will not work 
properly. How do you know if your cassette will work? Simple 
-open up the cassette deck and look at the printed circuit board 
components. If there are !C packages for all the active compo- 
nents, it will work with the RABBIT. If there are any trans- 
istors on the board, it will not work. Most new style cassette 
decks will work okay since there are very few of the transistor 
types. If you wish to purchase ROM RABBIT and a cassette 
deck, we can offer an attractive discount. 



The RABBIT commands are: 
S5 — Save with short leader 

- Save with long leader 

- Load a program 

- verify a program 

- Lead and then run 
■ RAM memory test 



SL- 
L- 
V - 
E- 
T- 



D — Convert decimal # to hex # 
H — Convert hex # to decimal # 
z — Toggle character set 
K — Kill the RABBIT 
* — Go to monitor 
G — go to machine language 
program 

RABBIT works with the PROGRAMMERS TOOL KIT. 
CASSETTE RABBIT ■ $29.95 EASTERN HOUSE SOFTWARE 
ROM RABBIT - $49.95 3239 Linda Dr. 

(specify memory, 3.0 or 4.0) Winston-Salem, N. C. 27106 



PROMINICO ■ PROIWINICO ■ PROMINICO • PROMINICO • PROMINKO -PROMINICO • PROMINICO • PROMINICO ■ PROMINICO • PROMINICO • PROMINICO 

TWO POWERFUL PROGRAMS IN ROM FOR YOUR PET/CBM 



XDOS ROM™-S97^ 



Everj'uscrot 

CDmniodorc's 2(14(1 Disk1i:i^ Iwcii waiting for XDOS. 
The nminlcnaiicc.mimipulaliim imdurganizaliim uf 
disk files is simplified siiicu ,\DOS eliniinalts llw 
rcpdilious dnidHL'i>' of disk work. DiSPLAY. COPY. 
SCRWCH, LO.'VD/HUN oporale from a fast Iwo-column 
Menu display. Multiple tiles can be selected with single 
key strokes and then copied or scratched as a batch 
without further input. Take advanlai^e of our unique risk 
free refund policy. Once you use XDOS you'll never 
(live it up. 

DMENU- Display or print contents of data file. 
CMENU- Copy any number of selected files as a batch. 
SMENU- Scratch any number of selected files as a 
batch. 

MENU- l.iiad and ran a pro(;ram. 
SCREFJN PKINT- Special key sequence copies the 
screen image to your printer. 
DIRECT PRINT -i'ut a'*'in front of any command 
and it will output to the printerautomatically. 

DOS SUPPORT -The complete DOS .SUPPORT 
(WEDGE) is included in the XDOS ROM. 
SAVEREl'L.ACE-XDOS makes SAVE" " ...and SAVE 
uithout a drive nuinhertonipletely safe and reliable. 

UPGR,\DEABLE All Proniinico software is supplied in 
reprogrammable ROM which can be upgraded \s hen 
required. 



MANUAL INCLUDED- Comprehensive instmction 

manual included. 

INDEi'LN'DENT-XDOS uses no RAM, and BASIC is 

unaffectedbyitsusc. 

COMI'ATIBILITY- XDOS is compatible with most 
other RO.Vi products and can be ordered to fit any of tlie 
three available R0.\1 sockets. 



SORT ROM™- S97.5" 



Ever}' serious 
projiraiu can benefit from the five utilities included; 

SOHT-Tliis command takes a list ol array names 
(siring, real and integer in any orderor mix) and sorts 
them based on the alphabetic or numeric order of 
the first array in the list. An example best illustrates the 
lle.\ibiiity of this command: Suppose you vrish to 
maintain an invoice list with the data held in the 
following arrays; 

C%(N) — Custiuner Number, n{N} — Invoice Number. 
A(N) - S Amount, DS(N) - Dale. It is nowa simple 
matter to put this list into order ol invoice dale, 
customernumber or amount owing. An Accelerated 
llcad.sorl algorithm with K ■ N ■ l.og(N| characteristics 
is used for extremely fast speed even on worst case data. 



P 



SORT TIMt; IN .SECONDS 


NO- OF RECORDS 


t.tioo 


j.OUO 


5,000 


10.0011 


INTtGER 


2.6 


8.9 


t5.6 


35.0 


liEAt, 


4.1 


16.7 


29,5 


- 


STRING 


ys 


15.5 







READ STRING-Tlns command is a much needed 
rcplacemenl forliS'i'UT* viith the following improve- 
ments. Maximum input string length increased from 
81) to 254 characters. Embedded COMMAS. COLONS 
and QUOTliS arc now acceptable data. Null string is 
relumed lorempty records, 

OITIMIZED READ, OPTIMIZED WHITE -These two 

commands drastically simplify and improve data 
storage on disk. Numerical data is written in binarj' 
instead of ASCII, potentially increasinjidata density by 
5(lll",ii. Data is stored vvitliuut the need for RETLiRNS 
between records thus allowing a string to contain any 
characlcre including RETURN, COLON. COM.MA and 
QUOTE In addition, a list of variable names need only 
be defined once and not in each read or write statement. 

FIND SUBSTRING POSITION - POS is a v eiy- fast 
string search function which locates the position of one 
string within another 



Risk Eree Warranty: one year replacement of defective 
ROM's, if you decide to return the ROM (undamaged) 
within 30 days we will refund the full purchase price 
including postage and you may keep the instmction 
matHi,il v\s!h our<-nnipl]iiU'Ols 

To order use Prominico Direct .Mat! Response Card in 
this issue or send; Cheque, Money Order, or Visa' 
Chargex (include e.xpiiy date and signature). Add S2.50 
postage for each ROM ordered. Specify which ROM 
.socket you want to fill. 

tMrt/t'liMareregisti^red IriiitenuirksitfC'innminiiire Business 
MiKltines. 



PROMINCO LTD., 1921 burrard street, Vancouver, b.c. vej 3H3. phone (604) 738-7811 for promit shipment 

PROMINICO ■ PROMINICO • PROMINICO • PROMINICO ■ PROMINICO • PROMINICO ■ PROMINICO ■ PROMINICO • PROMINICO • PROMINICO • PROMINICO 



120 



COMPUTE! 



Febfuary. 1981 Issue 9 



Three Pet 
Tricks 



John F. Gorst 
Department of Chemistry 
The University of Georgia 

This magazine and others have published numerous 
PET programming methods that are not evident 
from reading the documentation provided by Com- 
modore. Sometimes there is a subtle way of using 
what Commodore tells about. Then there are those 
things Commodore forgot to mention. Here are three 
tricks that I use. 

On-line Remarks 

With a PET, on-line remarks are made as follows, 

according to Commodore. 

200 : GOSUB 500:REM OUTPUT 

Both the statement-delimiting colon and the REM 
statement must precede the remark. Other im- 
plementations of BASIC allow the use of an 
apostrophe in the place of both of these, making pro- 
grams more readable. 
200 : GOSUB 500 'OUTPUT 

The PET actually allows the construction just given! 
However, the PET does not use the apostrophe as an 
abbreviation for REM. In fact, the PET allows the 
following construction. 
200 : GOSUB 500 OUTPUT 

Nonnumeric character strings that follow the target 
line number of a GOTO, GOSUB, or THEN state- 
ment are ignored. This is not true for all other kinds 
of statements. Nonetheless, it is convenient to be able 
to tag GOSUB statements with labels reminding the 
reader of the nature of the target subroutine. 

Flashing Cursor For Get 

Several notes have appeared showing how GET can 
be used to advantage instead of INPUT. Deal's re- 
cent article (COMPUTE, vol. 1, issue 6, p. 98) 
illustrates a routine related to some I have used. 

Deal uses a BASIC method to flash the cursor. 
According to C. S. Donahue and J. K. Enger, 
"PET/CBM Personal Computer Guide," 
OSBORNE-McGraw-Hill, Berkeiy, CA, 1980, p. 
106, there is a POKE address and a value that turns 
on the PET's cursor under control of its OS. The 
location is 548 for the "old" ROM set (version 2.0) 
and 167 for the "new" ROMs (version 3.0). I 
assume that the newest (4.0) ROMs use the same 
address as the 3.0. 

The values to be POKEd are to enable the 
flashing cursor and 1 to disable it. 



100 POKE 167, (turn on cursor) 

110 GET A$ 

120 IF AS = "" GOTO 110 

130 POKE 167,1 (turn off cursor) 

This seems to work fine. I have had no problem with 
its actual operation, but I have hacl a few "flying 
cursor" residues (reverse blanks) left here and there 
at unexpected places after having used these POKEs. 
I don't know whether these were from my program 
bugs or from something in the operating system that 
was upset by the POKEs. 

Pretty Printing 

The PET system gobbles up spaces that may be left 
between the line number and the first character of a 
statement being entered, with the result that all 
statements in a PET BASIC program are left- 
justified. One of the features of a readable program 
is the use of blank lines and statement indentation to 
emphasize the logical structure of the program. This 
is "pretty printing" (see P. Nagin and H. F. 
Ledgard, "BASIC With Style", Hayden Book Com- 
pany, Rochelie Park, NJ, 1978, or J. M. Nevison, 
"The Little Book of BASIC Style," Addison-Wesley, 
Reading, MA, 1978). 

By now it is well known that spaces can be in- 
serted at the beginning of a PET BASIC line if a col- 
on (":") is typed in the first or second space follow- 
ing the line number. 
100 : FOR I = 1 TO 10 
110 : X = X + 1 

120 : NEXT I 

What may not be so well known is that there is at 
least one restriction on this usage. A DATA state- 
ment that is not preceded immediately by a colon is 
ignored! Thus, the following will not work, 
110 : READ X, Y 

110 : DATA 1, 2 

Instead, this can be used: 
100 : READ X, Y 

110 : :DATA 1, 2 © 



m 




mimm 

InlocmatKXi Utilily 

USE YOUH PET AS A TERMINALI 

CB« 801O modi-m 5395.00 

EOUfiCt Hcok-UP SI 00.00 

lEKf. to tIEEE or PETl cablt S 50.00 

riM.IMF ■■:o ft warn $ 35.D 

TOTAL PACKAGE SJ79.00 



PETTED micro jystoms 

P Boi JiSil 

4^65 A inc^-s P:i,id 

MIL'.'.IUKEE l',' = rO*,5iN 53221 

<414|2B2.41S1 



New 

Micro Electronic 
Thermostat 




SiKM : ■IT* '01 f 



$150.00 



February. 1981 issue 5. 



COMPUTE! 



121 



Micrciphys is pleased lo announce ihe release of a scries of twelve 
progrums designed for use in inirtnluciory calculus cftiirsfs on boih 
the high school and tollege levels. 

The programs are iniended for use wilh a Commodore PCT/CBM 
microeompuier having al least 8K of storage, taeh program is record- 
ed on a C-IO cassette and is accompanied by simple deseriptise in- 
slruciions. The programs retail for S20 each. A diskette containing 
all 12 progranis may be obtained at a cost of S180. 

Hash program generates a unique set of problems for each student. 
Answers may be generated so thai the sttideni may eheek his own 
work or these answers may be suppressed. The student then solves his 
set of problems away from (he computer. When his work is com- 
pleted, the student enters his code number and answers and the com- 
puter will then grade his work, displaying the answers to those tjucs- 
tioivs which were incorrectly solved; a percent score and a brief com- 
ntem rcllecting an overall evaluation are also giveti. 

Individual Prii|;ram C'onlenI 
PCT26- Differentiation of Algebraic Functions 
PC727- Maxima'Minima Problems: Part 1 
PC72S- Ma\ima'Minima Problems: Pan 11 
PC72y- Relative Rate Problems: Part I 
PC730- Relative Rale Problems: Part 11 
PC731- Integration of .Algebraic I'unciions 
PC7J2- Differentiaiion of Trigonometric (-'unctions 
PC733- inlegralion of Trigonometric ('unctions 
PC734- Inlegralion: .Areas of Plane Figures 
PC735- Integration: Volumes of Solids 
PC736- Integration: Arc Lengths 
PC737- Integration: Surface Areas of Solids 

NiHer .All programs are available from your local computer dealer. 
They may also be obtained directly from Microphys. 
I'.ducators: Be sure to write for our free educational software 
catalogue which describes over 140 programs for use in Chemistry, 
Physics. Math, Lnglish Vocabulary and Spelling. These programs are 
designed for use on Ihe PET with a minimuiri of UK of storage. 
ncairr Inquires Invited 

MicROPHvs pro(;r.vms 

204S Ford .St. Bklyn, N.Y. 11229 

an) 646-0140 



CBM/PET Computers & Such! 



Features for Jan/Feb 8Q: 

Xymec typeurtCer/printer $2499 
Centronics 737 i SSI 

Reconditioned Sl^LliCTRICs 

11" carriage $ 'i50 

13,15" carrUec $ 550 

15" carr in desk $ W'> 

Micro Software Systems 

MSS Program Disti #1 % W 

Billboard for 8032 $ 3^ 

Billboard for 2001 S 29 

VJatanabe HtPt.OT SlfiS 

Ni;c Spinuriter #5530 $2499 
Uncrasher (for new 20t)l) i 15 
Modem for PF,T/CBM S 2K5 
PET/CBK Pcrs Corap Guide f 111 
Free cassette drive witti 16/32k CBH 



©»6 




CONNECT PET/CBM TO PRINTER: Simply plug Into Clic interface 
and use your PET/CBM computer with popular "standard" 
printers, or add a video monitor for a second display. All 
interfaces are assembled, tested, and uaraotced. No sottwarc 
is required. 

TU^65C Use NiX, Ceocronics, Kymec , or otlier industry 
standard parallel printers. Works with disk, other IEEE 
devices attached. $129.95 



Hcathkit H-li. 
rate desi red) , 



TU-651(i Use RS-232 (serlall printers, like 
300 to 4800 baud tplease specify 
Includes power pack. $79.95 

TU-PVE Connect your Video Monitor to PET/CBM for second 
display. tJur unique contact extensions leave the user 
port available for connection of other accessories, 
S39.95 (NOT for li016/32) 



KSCOH interfaces: 

SELECTH1C to PET/CBM 

to Apple, Atari, tiadio Shack 



5649 
$549 



MTST-I/0 CO Parallel 
Cables extra, »2(( to $90. 



Parallel 

RS-2J2 Serial J579 
$425 
Installation $100 



Virginia Micro Systems 



H4t5 Jctti'ison Dfl' 
\X'(mi!t>H(lr|*', Viigm 



1* Hiyht^ay 
a 2Z191 



(7031 491-6i02 



VISA/MC, VA +4% 
Factory auCh 
sales & service 
M-F 12-8, Sa 9-3 



IEEE-488 BUS 

SYSTEM BUILDING BLOCKS 

For Commodore PET/CBM and other computers, „ 




TNW-2000 

TNW-1000 Serial Interface: $129 
TNW-2000 Serial Interface; S229 

\ ;nann<'. muuT jnj output 

TNW-232D Dual Serial Interface: $369 
TN W-1 03 Telephone Modem: $389 

'•i.jin .answer aulo di,al Use *iln DAA 

^^^%^^piBf jk ^%t PTERM; A pmgfarnihai lulls your PET iniDale'minal 

^ll|" I VVnilC iU5C *.th TNW ?CI0n, TNW ;3JU, 01 TNW t03) 

SWAP: Alinw5 stoiage ot up 10 B p'ogfams in PET 

memory a! once Run thcTi m any order 

PAN: A s'jpriisiicalea eieclromc man program 

■ijse w-th TNW-103t 

Write or call (or inlormalion today: 



PLUS WobI pjpuUI i.ijnijjuli- 
liiks prir^tefS. CK 



TNW Corporation 

33S1 Hancock Street 
San Olego CA 92M0 

(714) 225-1040 



Whyls fcil^^ SoGood? 



Maybe it s because we've always had high slantjards. Be- 
ginning with our first issue m July, 1978. we've published some 100 
programs for Ihe Commodore PET in our lirst 20 issues, plus 20 
animated graphic "Front Cover ' programs Each program has 
been extensively edited by Glen Fisher, our Edilorlal Director The 
result IS obvious: Cursor programs reflect professional stan- 
dards. We're proud of every program we publish. 

Bui there's something else, too. 

It's imagination. Our subscribers continue to be delighted 
with the new. fresh programming ideas Ihat Cursor provides. 
Some of the best graphic animations for the Pet have appeared m 
Cursor. Teachers love us! They use Cursor as an example of 
what can be done on a PET with some skill and imagination. 

Finally there's sen/ice. Orders for smgle issues are almost 
always shipped within 24 hours. New subscriptions are pro- 
cessed within live working days. Should you gel one of our rare 
defective tapes, just return it for an immediate replacement. And 
of course you can cancel your subscription at any time and we'll 
gladly refund all remaining issues. 

Cursor Quality Imagination. Service. 

For only $4,95 you can buy a sample issue and judge for 
yourself. Or send S27 for a six-issue subscnplion. You'll get six 
C-30 cassettes, each with five programs and a Front Cover ready 
to LOAD and RUN on your PET With each issue you also get our 
Cursor Notes, a lively commentan, on the industry, as well as 
documentation for the programs 



J Sample issue of Cursor — S4.95 (CA. Res. add 6% tax) 
a 6 issues for S27.00 (U.S. & Canada) 



Published By 



\> 



The Code 
Works 



Box 550 

Goleta. CA. 93017 

Phone B05-967-D90S 



122 



COMPUTE! 



februarv, 1981. Issue 9 



\ 




M 



Get Fireworks From 
r *YourPET!^ 





DUNGEON OF DEATH CODE NAME: CIPHER 



TREKX 



TBEK-X Command the Enterpfise as you 
scour the quadrant for enemy warships. 
This package not only has superb graph- 
ics, but also includes programming for 
optional sound effects. A one-player 
game for the PET 8K. Order No. 0032P 
$7.95. 



DUNGEON OF DEATH Battle evil 
demons, cast magic spells, and accumu- 
late great wealth as you search for the 
Holy Grail. You'll have to descend into 
the Dungeon of Death and grope through 
the suffocating darkness. If you survive, 
glory and treasure are yours. For the PET 
8K. Order No. 0064P S7.95. 



ARCADE I 

ARCADE I This package combines an ex- 
citing outdoor sport with one of 
America's most popular indoor sports: 
• Kite Fight- ll'sa national sport in India. 
After you and a friend have spent several 
hours maneuvering your kites across the 
screen of your PET, you'll know why! 
•Pinbal!-By far the finest use of the 
PET'S exceptional graphics capabilities 
we've ever seen, and a heck of a lot of fun 
to boot. 

Requires an 8K PET. Order No. 0074P 
$7.95. 



CODENAMEiCIPHER 

Enjoy that same feeling of intrigue and 
discovery with the Code Name: Cipher 
package. Included are: 
•Memory Game-Would you like to 
match your memory against the com- 
puter's? You can with the Memory Game. 
•Codemasler- One player types in a 
word, phrase, or sentence, and the PET 
translates that message into a crypto- 
gram. The other player must break the 
code and solve the cryptogram in the 
shortest time possible. 
•Deceitful Mindmasler-This isn't your 
ordinary Mastermind-type game. You 
must guess the five letters in the hidden 
code word. 

•Code Breaker- Cracking this code 
won't be as easy as cracking walnuts. 
You'll need to fiex your mental muscles 
to win this game. 

If you want a mental challenge, then 
Code Name: Cipher is for you. For the 8K 
PET. Order No. 0112P. $7.95. 



Instant Software 



M 'A trademark of Commodore Business Machines 

PETERBOROUGH, N.H. 03458 
603-924-7296 



February. 1981. Issue S. 



COMPUTE! 



123 



Captivate Yourself. 




SANTA PARAVIA AND FIUMACCIO 

Become the ruler of a medieval city-state 



as you struggle to create a kingdom. Up 
to six players can compete to see who 
will become the King or Queen first. This 
program requires a PET 16K. Order No. 
0175P.S9.95. 



CHIMERA 



CHIMERA If you think the legendary 
Chimera was hard to handle, wait until 
you try the Chimera package. Included 
are; 

• Reflex — Round and round the little 
white ball rolls. Only fast reflexes can 
guide it into the center of the maze. 
•Dragon — You'll have to shoot down 
those pesky, fire-breathing dragons with 
your cannon. If you succeed your castle 
will be safe, if no! it will mean a call to 
your fire insurance company. For one 
player. 

•Dungeon — A very punctual guard 
comes down to the dungeon every day to 
torture you. This means that you have on- 
ly tfiirty seconds to dig your way under 
the castle to freedom. For one player. 
•Dragon Hunt-You must go forth and 
slay a fire-breathing dragon. The only 
thing that will protect you from the 
flames isyourshield, if you know when to 
use it. For one player. 

• Dropoll — You must make your oppo- 
nent's men "dropoff" the board by mov- 
ing and firing your own men. For one or 
two players. Order No. 0110P.S9.95. 



PET DEMO I 

PET DEMO I You can give yourself, your 
family, and your friends hours of fun and 
excitement with this gem of a package. 
•Slot Machine — You won't be able to 
resist the enticing messages from this 
computerized one-armed bandit. 
•Chase — You must find the black piece 
as you search through the ever-changing 
maze. 

• Flying Pheasant-Try to shoot the fly- 
ing pheasant on the wing. 

• Sitting Ducks - Try to get your archer to 
shoot as many ducks as possible for a 
high score. 

•Craps — It's Snake Eyes, Little Joe, or 
Boxcars as you roll the dice and try to 
make your point. 

• Gran Prix 2001 - Drivers with experi- 
ence ranging from novice to professional 
will enjoy this multi-leveled race game. 

• Fox and Hounds -It's you against the 
computer as your four hounds try to cap- 
ture the computer's fox. 
For true excitement, you'll need a PET 
8K. Order No. 0035P S7.95. 



TO ORDER 



SEE YOUR LOCAL 
INSTANT SOFTWARE 
DEALER 



OR 



^ 



Santa Paravia 
and Fiumaccio 



The most captivating 
and engrossing pro- 
gram ever made for 
the PET- 

It is tfie dawn of the 15th Century; 
you rule a tiny Italian city-state. Your 
goal: The Crown! 

Up to six players can compete as 
rulers of neighboring cities. You con- 
trol the grain harvest, feed your serfs, 
set tax rates, dispense justice and in- 
vest in public works. 

The future of your realm will de- 
pend on your decisions. If they are 
wise, your city-state will grow and 
you will acquire loftier titles. If your 
rule is incompetent, your people will 
starve and you may be invaded by 
your neighbors. 

How will you rule your kingdom? 
Will you be an enlightened leader— or 
an unscrupulous despot? Only you 
can answer that question— with San- 
ta Paravia and Fiumaccio. 

DOW JONES 

DOW JONES Up to six players can enjoy 
this exciting stock market game. You can 
buy and sell stock in response to Chang, 
ing market conditions. Get a taste of 
what playing the market is all about. Re- 
quires a PET with 8K. Order No. 0026P 
S7.95. 

We Guarantee It! 

I 1 5^ Guarantee '-^^ | 



(P^ Toil-Free 
1-800-258-5473 



Instant Software 



i 



OIR PKOGR.VMS .\KI-. f;U.VRANTri S^ 
TO HF OL'ALITV CKODVC rS. IF NOI ^ 

(OMPLi rrLi s.Mi.siiii) vol! may ag 

_ K! IIRS Till I'KOt.KAM WITIilN ^0 SS 

m D.V-r S A (KfUJII UK Kl-I'LAtlMI.Nr ^ 

^ WIN UK Wn.l.lN(;i.Y GIVEN FOR ^ 

"S ASYKfASON. mp. 

Prices subject to ctiiarige wittiout notice. 
' A Trademark of Commodore Business Machines 

PETERBOROUGH, N.H. 03458 
603-924-7296 



124 



COMPUTE! 



February, 1981 Issue 9. 



Review 

PASCAL On 
The Pet 



A J. Bruey 
Jackson, Ml. 

The use of Pascal is becoming more widespread 
every month if the number of magazine articles and 
advertisements about Pascal and Pascal products can 
be used as an indication. Pascal began as a teaching 
language. It is recognized to be an excellent first 
language for programming students because the 
structured features of Pascal make it possible for the 
student to learn efficient programming techniques. 
Now more and more business applications written in 
Pascal are beginning to appear on the market. 

I had been studying Pascal from a manual with 
no computer to try it on. Then Abacus Software (PO 
Box 7211, Grand Rapids, MI 49510) announced the 
availability of a PET and APPLE version of Tiny 
Pascal. This version is based on the Yuen/Chung 
series in the September-November, 1978 issues of 
Byte Magazine. The Abacus Software system is pro- 
duced through a licensing agreement with SuperSoft 
of Champaign, Illinois. 

The Pascal Package 

The Pascal package contains three programs: 

A. A line editor for developing and maintaining 
Pascal source programs. 

B. A compiler for compiling the source code into 
p-code. 

C. An interpreter to interpret and execute the 
p-code. 

The editor and compiler are written in BASIC and 
the interpreter is written in 6502 assembler. Source 
programs and p-code files can be saved on either disk 
or tape in the PET version. The APPLE version re- 
quires disk operation. 

Writing a Pascal Program 

First the Pascal source program is written using the 
line editor. The compiler is used to convert the 
source code to p-code. The p-code is then run inter- 
pretively using the interpret program. The p-code 
program executes much faster than a BASIC Pro- 
gram performing the same function. 
Advantages of this system 

Inexpensive. At $35.00 for the disk version and 
$40.00 for the tape system, it's a good buy for 
anyone who wants to try Pascal. 
Structured constructs. This version contains all the 
structured features for which Pascal is noted: 



FOR. ..DO 
WHILE.. .DO 
REPEAT. ..UNTIL 
CASE 

IF.. .THEN., .ELSE 

Simple to use. Excellent documentation including 
both the source code and p-code for two sample pro- 
grams. Step-by-step operating instructions make it 
easy to learn. 

Abacus Software provides excellent customer 
support. 

Disadvantages 

Like other "tiny" language implementations, this 

version is an integer-only implementation. The only 

data types are integer and integer array. 

There are no built-in functions. None of the usual 

Pascal functions such as SQR (square) and SQRT 

(square root) are available. 

Rather slow. In the limited testing that I've done, 

I've found that the compiler takes three to fou.- 

seconds to compile each line of source code into 

p-code. 

Poor I/O facilities. There is no provision for disk or 

tape input or output during program execution. 

There is also no way to direct program output to a 

printer. 

A Sample Program 

i ■ CSQRT - INTEGER SQURRE ROOT] 
k' ■■ CuNST CR=13.: 

3 : V'RR X..HUrlE£R..r)EMORy,. COUNT.. fl'IHTECCR.; 

4 : FUNC SQRTCKX.- 

5 ■ BEGIN 

6 ■ l-]£mRV=l; 

7 ■ R:=e.: 

S - WHILE >0=& IiO 

9 ■- BEGIN 

10 : ;-•: : =;<-riEfioRV.; 
] 1 : R : =a+i ,; 

J 2 : MEM0RV:=MEMDRV+2.; 

13 : END.: 

14 : S«RT:=fl-l; 

15 : EHIJ.; 

16 : BEGIN 

17 - NUMBER =1.: 

IS : WHILE NUnEER:>0 DO 

19 : BEGIN 

20 : WRITER -ENTER fl NUMBER '.>.; 

21 : RERIiC NUMBERS;,; 

22 : COUNT :=SQRT';NUt!EER:.'; 

23 : NRITE'XR. 'SQURRE ROOT IS ' .. CCiUHT# .CP J 

24 : ENIi.: 

25 : EHIi. 

The listing shows a sample Pascal program that was 
developed and run under this system. It was the first 
Pascal program that I wrote and thus the coding is 
probably far from optimum. It is an integer square 
root routine based on the method described in my 
previous (November, 1979) MICRO article "Perfor- 
ming Math Functions in Machine Language". The 
reader may either refer to that article or may 
discover the algorithm for himself by following 
through the coding. 

A brief description follows for those of you who 
are not familiar with Pascal. 
Line 1: A remark line. Not executed. 
Line 2: Defines the carriage return character. All 
constants must be defined in a CONST section. 



Februarv, 1981. Issue 9 



COMPUTE! 



125 



NEWUFE foir 
old Fete? 

Is it a dreani...ls it fantasy? 




Switch, from old B.OMs to new 

• Not sure about the ROM Retront Kit from Commodore? 
Nowyou oan use all three eets of Commodore EOMa and 
others as well. 

• The Basic Switch allows switch selection of either ROM 
BBt (your original setoryour retrofltaet) from Commo- 
dore. Plus, Models 1&-A and 15-B Include an additional 
zero InBertlon force socket allowing easy use of ROMs 
Ilka the BASIC Programmer's Toolkit.. .concurrently 

• Models 15-A and 15-B The Basic Switch plus. ..Includes 
expanded cable assembly and zero Insertion force 
socket- Your 16th ROM simply plugs in. .enabled while 
either ROM set Is selected. Socket 15 may be readdreaaed 
by the user for additional flexlbUlty. 

• The Basic Switch la sold In assembled form only. All 
models are designed for easy attachment to your PET 
with a convenient cable assembly. No soldering or 
drilling Is required- The Basic Switch mates with acable 
assembly at your primary board, and does not use the 
physical connectors ofany PET porta- 

• Our prices and complete product specifications are 
available by ODntactlne APPLIED MICRO SYSTEMS, 
Miahawaka, Indiana; or any Commodore Dealer. 



Dealer Inanlrles are encouraged. l*ee MACHIIOS LAJTOUAOB MONITOR COMMAHDS List wlU be 
Included with pricing and product specification requests. 

PPPUED miCRD SVSTEmS 

3502 Home Street, Mishawaka. Indiana 46544 • 1-219-259-3787 (Indiana) • 1-800-348-7208 



Line 3: Declares all variables that will be used in the 
program. All variables must be declared in the VAR 
section. 

Lines 4 to 15: This function is the actual square 
root routine. X is the dummy argument which is 
passed to the function from the calling statement in 
line 22. 

Lines 16 to 25: This is the main section of ihc pro- 
gram. Line 20 prompts for an integer, line 22 calls 
the function, and line 23 displays the answer. 

Recall that this is an integer Pascal. You will 
always get just the integer part of the answer. For 
example, you will (correctly) get 25 as the square 
root of 625, but you will also get 25 as the square 
root of all numbers from 626 to 675. To get more 
accuracy, you must develop multiple precision 
routines just as you would have to do in machine 
language. 

The listing was printed using the line editor. 
Other functions of the editor are append, delete, list, 
change, replace, load, and save. 



Conclusion 

After weighing the advantages and disadvantages 
listed above and using the system for a few days, I 
have concluded that this program is well worth the 
price. It is quickly becoming one of my favorite soft- 
ware packges. Those of you who are not used to 
structured languages will find it interesting to solve 
program design problems without the use of a 
GOTO statement. < 



126 



COMPUTE! 



February, 1V81 Issue 9 



Review 

The PEDISK 
From CGRS 
Microtech 



Dr, J. A. DJIts 

Department of Chemistry 

Ur^lversity of North Carolina 

at Greensboro, Greensboro NC 274t2 

The addition of a disk to ones microcomputer system 
is a need that becomes evident after a short period of 
loading programs from cassette tape. Any attempt at 
even modest data handling amplifies this need. For 
the owners of the original 8K PET coinputer, this 
presents a problem in that Commodore's disk system 
is incompatable with the original ROM operating 
system. For those of us who purchased the early 
PETs, there is an alternative to updating the ROM 
operating system or selling our old PETs in order to 
add disk capability. The CGRS PEDISK goes 
beyond offering a high speed means of loading pro- 
grams and saving data in that it akso provides access 
to the S-100 buss. This offers expansion not only in 
terms of memory, but a host of other possibilities 
such as analogue to digital boards, modem boards, 
etc. 

In the standard configuration the CGRS 
PEDISK system offers two free S-IOO slots. It is 
possible to add another S-100 connector at additional 
cost. The 5.25 inch drive uses soft-sector diskettes. 
The format is the IBM 3740 standard. This provides 
80K of storage per drive. A total of 4 drives can be 
handled by the S-100 disk controller board. 

Although this system was originally designed to 
operate with the original PETs, it is now available 
for the newer 16 and 32K versions. 

The Disk Operating System 

The disk operating system provided by CGRS is par- 
tially in ROM, but is basically a RAM oriented 
DOS. Although there is an overhead with such an 
approach (about 2K of memory is taken up by the 
DOS), the advantage of having the DOS in RAM 
rather than ROM is that it is possible to make 
modifications, be they up-dates or correction of bugs. 

The DOS is initialized by a SYS call to a boot 
starting in ROM at hex BOOO. The disk operating 
system is loaded into the top 2K of RAM and is 
subsequently protected. 

Loading and saving programs is accomplished 
by precceding the usual BASIC command with a " I 



", for example: 
!LOAD"program iiain(;:0" 

where is the number of the disk drive. Unlike pro- 
gram names on tape, program names on disk are 
limited to 6 characters. Provision is made for renam- 
ing programs or data files. As witii any disk system, 
duplicate programs are not allowed. 

One of the most appealing features of the DOS 
lies in its file handling capabilities. Files may be 
opened as serial access or indexed types. In the first 
case, files are written and read from the hrst entry to 
the last. In the case of indexed files, any record may 
be written and/or read back in any order. Once a file 
has been opened for writing purpo.ses, it may be 
reopened for reading and/or editing. This allows one 
to examine a file record by record and perform 
editing (rewriting) on a record by record basis. There 
are two reserved variables for checking on successful 
file write and on encountering the end of file. File 
closing is automatic with the command (CLOSE or 
when the system is initialized. Up lo four disk iiles 
may be opened at one time and each maintains its 
own index counter through a common reserved 
variable. Commands normally used in dealing with 
tape files are proceeded by "!" in the case of disk 
files, i.e. ! INPUT F$ ZS where F$ is the string con- 
taining the file name. 

The command !SYS transfers control to the disk 
monitor. Here commands can be entered as a single 
character without using the return key. In this mode 
keying in "H" will list the currently available single 
key commands. It .should be noted that in this mode, 
any current BASIC program will remain intact and 
pressing "R" will return one to the BASIC 
operating mode. 

Commands in the DOS monitor mode include 
DUMP which will cause a formatted dump of either 
memory or disk sectors, GO to execute a machine 
language program, KILL to delete a file from the 
disk, LOAD to load a program without execution, 
MEMORY, a command to examine and change 
locations in memory, PRINT the volume table of 
contents of the disk, RENTER the BASIC operating 
system, SAVE to save a BASIC or as.sembly 
language routine and UTILITY to access routines lo 
compress disk files, copy disks, read or write a disk 
sector or initialize a diskette. All of these cominands 
are actuated by typing in the first letter of the com- 
mand. 

In short, the DOS affords a very neat package 
especially with respect to data file manipulation. ' 
Documentation is adequate, especially if you have 
had some experience with other disk operating 
systems. As with any new system, .some c.vperimenta- 
tion will be necessary for the user to become familiar 
with ail the features of (he system. Not all of the 
commands mentioned under the monitor will work 
from the BASIC control mode but tlii.'; minor bug 
will doubtless be corrected in future editions of this 
program. This is a great advantage in a RAM 



February. 1981 Issue 9, 



COMPUTS! 



127 



oiicnu'd DOS. I found tlio software (o bt: rela- 
[ively IVct- of BUGs. 

Because of the 2K overhecl in RAM, it would be 
advisable to have a minimum of 16K RAM for such 
a sv'stem. The potential user should also be aware 
(hat if a change in memory size occurs, an updated 
version of the operating system must be obtained. 

In brief, the CGRS PEDISK offers in a neat 
package both disk capabilities and access to S-100 
buss boards. This latter point has been most import- 
ant in terms of applicalions of this re\'iewer. @ 

Review 

A Disk Operating 
System for the 

CGRS PEDISK 

Dr. J. A. Dilts 



When I first saw the PEDISK in operation nearly 
three years ago, I was not overly impressed. The 
capabilities at the time were limited to saving and 
loading programs with no data file handling. It was 
not long before this original disk operating system, 
KMMM (by Wilserv Industries, PO Box 115 Had- 
don Field, NJ 08033) had been expanded to include 
full file handling abilities. 

The great advantage of any operating system in 
RAM is relative ease of updating and incorporating 
improvements. When working with a disk system, 
the time spent in loading software is not a major pro- 
blem. 

The basic configuration involves initialization 
via a SYS call to a ROM based boot which loads the 
DOS into the top end of memory. The user must 
specify his memory configuration when ordering the 
DOS software for, although a 24K version will work 
on a 32K configuration, the top 8K will be 
unavailable for normal basic programs. 

After initialization, the user has a chance to 
specify a change in the date or his configuration (i.e. 
number of drives, printer, maximum number of files, 

etc.). 

Afier any changes have been made, the user 
may return to the BASIC operating mode or to the 
DOS monitor. The DOS resides in about 3K of 
memory so a good minimum memory to use with 
this system is 16K. 

The usual BASIC commands such as LOAD, 
SAVE, etc. are precceded by a SYS 999 when used 
with the disk. This saves the user the task of 
remembering the address of the entry point of the 



DOS. If the second cassette buffer is being used for 
an assembly language routine, the 999 address can 
be replaced by the actual address of the DOS entry 
point. 

All special disk commands can be executed from 
BASIC. Routines for printing the volume table of 
contents, compressing a disk, deleting a program, 
etc. are included here, but the routines are loaded 
from disk into low memory and may write over a 
resident BASIC program. 

The volume table of contents gives address in- 
formation on the disk as well as memory. It also pro- 
vides the date of creation of the disk file and in the 
case of program files, how many times, and date of, 
updates. 

Provision is made for re-naming files and alter- 
ing the file load point. The copy/compress routine 
offers the capability for copying individual files or the 
total disk. Copying is possible with only a single 
drive. The format on the disk is the IBM 3740 stan- 
dard and the capacity is about 80K. 

Data files in the present version are sequential 
only. These may be opened as read or write files but 
not both and the number of sectors reserved for a file 
must be specified at the time the file is created. Pro- 
vision is made when initializing a diskette for omit- 
ting the boot, thereby saving more room when only 
files will be stored. File commands are like tape file 
commands except they are preceded by the SYS 999 
command. Closing a file does not automatically write 
an end of file mark; this must be done under pro- 
gram control before the file is closed. 

Up to 9 disk files can be open at one time (or 
the maximum number specified at the time the 
system was initialized). When a disk is formatted 
without the bootstrap capability, the maximum 
number of files for that diskette is specified (from 3 
to 67). 

The only means of updating a file with the pre- 
sent version is to open a second file for writing (with 
a different name or on a different drive) then read 
from the first file and write the modified or added in- 
formation on the second file. 

One neat feature of this system is its ability to 
chain programs, When the SYS999 LOAD' file 
name' is executed from a BASIC program, the 
named program will load and run with variables 
from the first program intact as long as the calling 
program is at least one sector greater than the pro- 
gram. 

Either (he contents of a disk or the VTOC may 
be routed to a printer if the printer option is specified 
when the system is initialized. The printer must 
operate on the IEEE port and its specified address. 
In the year that I have been using this current 
and an earlier version of the KMMM DOS, I have 
found it to be very flexible. It has offered an ex- 
cellent solution for disk capabilities for PETs with old 
ROMs. C 



128 



COMPUTE! 



February. 1981. Issue 9 




A Terminal For 
"KAOS" (Kim, 
Aim, OSi, Sym 

Bruce Land 
Baltimore, MD 

A "terminal" is what you use to send messages to 
the computer and to receive messages from it. 

KIM and SYM have a terminal buih in -- a hex 
keypad to send messages, and a 6-digit hex LED 
panel to receive them. The arrangement is simple, 
economical (in initial cost, at least), and slow. Sooner 
or later, one tires of using only the onboard hex pad 
and 6-character LED display, and yearns for an 
ASCII keyboard and CRT display. 

Rockwell's AIM has a keyboard, 20-character 
display, and 20-character printer, and Ohio Scien- 
tific's Superboard has a keyboard, video board, and 
RS232 output; even so, owners of these other 
popular 6502 systems sometimes want an external 
video board to display longer lines. 

Many articles on how to attach different com- 
binations of keyboards and displays have been 
published. Let's look at some of the pros and cons of 
different systems, and then at the one I chose. I 
believe the one I chose is, for a one-board system, 
about the most cost-effective method of obtaining a 
very versatile ASCII-plug keyboard input and a 
memory-mapped video output to a CRT display. 

Of all the ways to obtain ASCII I/O, the 
simplest and perhaps the cheapest is to use a parallel- 
connected keyboard and a video RAM display. Hal 
Chambcrlin, in "Software Keyboard Interface with a 
Pittance of Hardware" (Kilobaud, January 1978), 
discusses how to install an unencoded keyboard as a 
software scanned device connected to a PIA-type 
parallel input port. This uses a minimum of hard- 
ware, and not much CPU time. The OSI ClP and 
C4P, the Apple, the PET, and others use a similar 
method to connect their keyboards. 

Chamberlin gives complete schematics and KIM 
software. Software for other 6502 systems would be 
very similar. The hardware will work with any port 
and should cost less than $30. 

Don Lancaster announced the first KIM pseudo 
"video RAM" in Kilobaud (June 1977) and in 



Popular Electronics Quly 1977). Complete schematics 
were published, and some software. Kits were 
marketed for about $35 by PIA Electronics, Inc., 
1020 W. Wilshire Blvd., Oklahoma City, OK 73116. 
This system relied on the CPU to run the display, 
and while the CPU was busy elsewhere the video 
was blank. For continuous display it was necessary to 
write software to have the CPU maintain the display 
and run the program at the same time. A 
foreground/background type of operation is needed, 
and this can get quite complicated. 

The amount of CPU time required for the Lan- 
caster display varies, but you can get an idea from 
the hex keyboard scan and display of the basic KIM, 
There, about 20% of the CPU time is spent on I/O 
software. To use the Lancaster system, decide how 
much delay you can tolerate in keyboard response, 
how long you want to display, and how often you 
will scan the keyboard for an entry -- five times a 
second, ten, or more -- and write your software 
accordingly. 

Anything you store in a true video RAM 
memory location will be output as a composite video 
signal and displayed. The display is refreshed with 
TTL logic, not CPU time. A software-scanned 
keyboard and a video RAM are the fastest way to 
make an entry and get an ASCII character 
displayed. A video RAM is about the only practical 
way to do animated graphics. 

M.T.U., P.O. Box 12106, Raleigh, N,C. 
27605, now sells a true video RAM for approxi- 
mately $300, assembled and tested. The M.T.U, 
board has 320 X 200-bit resolution (64,000 bits, or 
about 8K of RAM), which is the highest I have seen. 

The big disadvantage of a video RAM driven 
CRT display is the lack of softwre compatibility. 
Almost all, maybe 95% of the software published for 
KIM, AIM, or SYM, is built to run with the respec- 
tive ROM-based monitor program. That means you 
will have to rewrite the I/O of the software to run 
with a parallel keyboard and a video RAM. If you 
expect to write or adapt most of your software, then 
this method is very attractive; if you tk:m't want to 
write a lot of special I/O programs, you should think 
twice before going this way. 

A "6502 Video Driver Routine" software 
package is available for KIM from Forethought Pro- 
ducts, 87070 Dukhobar Rd., Eugene, OR 97402, 
(503) 485-8575. It furnishes cursor movement, line 
and page functions, scrolling, etc., and should save 
the good programmer some time. Video RAM cards 
are made by several other manufacturers: Matrox 



February, 1981 Issue 9. 



COMPUTE! 



129 



(5800 G Andover Ave, Montreal, Quebec H4T 
1H4, Canada, telephone (514) 735-1182) has several 
models from $225-$500; The Computerist (34 
Chelmsford St., Chelmsford, MA 01824 (617) 
256-3649) has one for $245. 

You want hard copy? A popular hard-copy out- 
put device is a teletype, known to several generations 
of ham radio operators as a TTY. KIM, AIM, and 
SYM have built-in monitor routines for TTY's and 
other serial devices. (I get tired of writing KIM, 
AIM, or SYM. We need a symbol to refer to all 
three systems. Try KAS. Or we could add OSI, 
another popular 6502 system, and call it KAOS, pro- 
nounced "Chaos.") 

A used TTY sells for $500 up, and will furnish 
readable, dependable, noisy, all-caps, llO-baud out- 
put. A TTY may also have a paper tape reader 
and punch for mass storage, but don't bother with it. 
The KAOS cassette tape storage is quieter, more 
reliable, and faster. The graphics capabilities of a 
TTY are very limited. 

Other printers are available with parallel or 
serial I/O, grpahics capabilities, upper and lower 
case, and better print quality. Of course, they usual- 
ly cost more. Among them are Centronics terminals, 
the Texas Instruments Silent 700, Decwriters, 
Diablo, Q^ume, etc. 

The great advantage of a serial terminal is that 
it works directly with the KAOS ROM's; no RAM 



is required to run it, and software purchased for any 
of the KAOS systems will run as a "black box" 
-just hook it up (which brings to mind the simplicity 
of this operation for a serial device: only three wires 
are needed. Hook up signal in, signal out, and 
ground, and you're ready to go.) 

Hard copy output is a real plus, but there is 
something anomalous in paying three or four times 
as much for a printer as for the computer that drives 
it. Anomalous it may be, but a S3000 Diablo dances 
nicely to the tune played by a KIM that only cost 
$245 four years ago when it was shiny and new. 

A video terminal such as the Lear-Siegler 
ADM-3 has all the serial advantages of a TTY, but 
no hard copy. Telecommunications, Alexandria, VA 
22303, (703) 683-4019, sells rebuih Datapoint video 
terminals for $500 up. New terminals can be found 
from $750 to $3000. But why buy a S750 terminal 
for a $180 CPU? You can buy a complete PET or 
OSI computer for not much more! 

The answer, of course, lies in your purpose. If 
you're going to use the computer occasionally, for no 
more than a few hours a day, then limited line length 
and readable print quality may be all you need. On 
the other hand, if you're going to do extensive word 
processing or software development, and will be look- 
ing at the display for hours at a time, you may be 
willing to pay a lot more for a sharper, cleaner 
display, with 80-character lines. 



The Seawell little buffered mother 

The LITTLE BUFFERED MOTHER . MJHMBHHPHb ^ siot. The whoie system can be run 

provides the most general possible h^^n CPUmaaiUUUKUlGr IDH ^^°'^^ regulated supply by shorting 

expansion: Mlling in the first 8K of ^T ^m ?££mKffig j^ "SM f^l'^? S^P°^^^^f3\;K?Lcn^^^^^ 

the memory map with RAM and ^ C^B^r _ " _ ". "W LimE BUFFERED MOTHER a so 

buffering all of the E-connector lines ifc.->^. ^.. = T^ ^gmmxmjgnB T SM ^^^ '^[ff aI^u "^^''hl ,?.fT^v c^^.h 

allows straightforward expans-on in W^'^^^'^^^^""^ ^ fs"a!so provided 

for a bank select line allows for ex- J^ El' 1'lliillS ^& i it.i» H,,(fBrBri Mnthpr 

pansion beyond 65K and/or the ability |^ , , -£iM^^i^m^^- ^ ^^ p^^ ^Jm 

to switch devices in and out of the F^-,...-,^ _ ^^^^^Zt^'^^—^^ wIoRam .:;:::ii59 

memory map. The four board slots i jj Bj JL- OAllByEifeJft-JttJ J3 j-jJ'="--- Ram kii $ so 

are sufficient to expand with 16K RAM ^is.J'S^^'^^'" »^S^^^5^S- , _. 7-#' H^ . Connects directly to me kim. sym or aim 

boards (SEA-16 or equivalent) or SHpSl^MMiBliSS^W"' S^ I M^ri^^'^ls.ais 

EPROM (SEA-PROMMER II) to 65K. ^«AW*l*Pl«aBiM^K*^l|l- aji . 4k ram on board 

The connector on the back of the •Mjt°j£Jl "^---S^^; •^iti^^'sjsffggj^ mi~ • Application and expansion romeclors available 

LinLE BUFFERED MOTHER allows -""^ ■^^, " i -jT^iiF^'^ , ^i •.L'Xsl^llT^^n.r'''^''"''''" 

further expansion of the motherboard '■■'-S' /?'■■" ..<;::■;:-. ..^/Tr': . fuii decoding lor ttie kiu-i 

/CPA kilAVI KdnTHFRl The back con- , - -' •■ tVi'iViiLi'iiVVt * Powei, NM\ and IRQ sialjs LEOs 

(SEA-MAXI-MU I HtH). i ne OaCK con _^ „..ii. , ._ ^ -s Hm tt U t m -, , Provision tor adailional moiherboards 

nector can also be used as a board ._ _,' i 



SEA-1 

SEA-16 ... 
SEACMOS 



SEA-DEBUG 
SEA-FDC/8. . 



SEA-ISOC 
SEA-LBM 



SEA-MAXI MOTHER 
SEA MICRO MOTHER 
SEA-PIOB 

SEA-PROMMER II . . , 
SEA-PROTO 



SINGLE BOARD DEVELOPMENT SYSTEM 

16K RAM BOARD „ „ „.., 

DAY/DATE CLOCK 6 2K EPROM SOCKETS & BK CMOS RAM 

7K NMOS BAM. 1K CMOS RAM 

WITHOUT RAM 

CVT POWER SUPPLY K It 

. THAI>JSFORMER ONLY 

HARDWARE BREAKPOINTS AND TRIGGERS 

DOUBLE DENSITY DOUBLE SIDED DISK CONTROLLER 

(W/DQS for SEA-1) ,;aV,;;.. 

B SERIAL PORTS WITH LOCAL PROCESSOR S DUAL PORT RAM 
LITTLE BUFFERED MOTHER FOR KIM. SYM, AIM w'-lK RAM 

WiTHuU I HAM 
RAM KIT ■ ADDITIONAL 4K ol RAM & BUFFER FOR LBM/B 
10-SLOT MOTHERBOARD 

JSLOT MOTHERBOARD 

A FULLY-BUFFERED 652Ss 

EPROM PROGRAMMER ■ ■ ■ ■ ■■■■ ■■■■■ 

COMPLETE LY DECODED PROTOTYPI NG BOAR D POPULATED 



S59S 
$280 
S595 
S395 
$299 

sno 

S 55 
$310 

S425 
S595 
S199 
$159 
$ 50 
$135 
$ 70 
$260 
$299 



Seawell proAicts are also available from 
Excerl Incorporated and 
AB Computers. 



c 



J2 





^' "~ . 




K^^ 


1/5 


jte;,; 


2 








J^sil'plf^^ 






£o 





^ 



# 



BLANK S 49 

J^E^AY^SpIgIoUND HEIGHT ON ALL PREPAID OHpEf PRICES AND SPEC,p,c,t,ONS 
ARE SvJBJECT TO CHANGE V/ITHOUT NOTICE VMSHINSTON RESIDENTb AUL) 5 J -= 
SALES TAX MASTERCHARQEWISA ACCEPTED 



SEAWELL 

BOX 30505. 
SEATTLE, WA98103 

206/782-9480 



130 



COMPUTE! 



February, 19S1 Issue 9 



Even if hard copy will be needed at some stage, 
there are advantages in being able to work with a 
CRT screen up to the point of the print-out. A CRT 
screen displays text much faster than a TTY, 
displays it quietly, and does not waste paper. 

The video RAM is one way to get ASCII I/O; 
another is with a serial video system, sometimes 
called a "glass TTY." This is a video board with a 
parallel keyboard port and a serial ASCII I/O port. 
You add: 

(1) your own monitor, modified TV, or RF modulator 
with an oridnary TV 

(2) power supply; 

(3) parallel ASCII keyboard; 

(4) and some kind of case. 

Now you have a serial video terminal with 
capabilities similar to those of the ADM-3. 

These video boards come in all stages of com- 
pleteness, price, and features. You can get RS232 or 
20ma I/O; 32, 64, or 80 characters per line; upper 
case only, or up to 128 ASCII characters; all-TTL 
logic (a very old design), or ROM-based CPU; slow 
or fast; with or without keyboard; one to three power 
supplies required; $150 to $500. Be careful in your 
choice; a high price may signify an old, expensive 
design. 

Any of the KAOS machines will think this kind 
of terminal is an ordinary serial terminal, and most 
software will run without any modification. Such 
systems can be purchased from many suppliers. I 
know of these: 

Electronic Systems, San Jose, CA 95151 (408) 
448-0800 ($200 for kit; keyboard needed); 
Xitex Corp., 9861 Chartwell Drive, Dallas, Texas 
75243, (214) 349-2490 ($175 kit; keyboard needed; or 
$375 for full kit including keyboard, case, etc.); 
Electrolabs, Box 6721, Stanford, CA 94305, (415) 
321-5601 ($239 A & T; keyboard needed); 
Mostek Corp., 1215 W. Crosby Rd., Carrollton, 
TX 75006 (214) 242-0444 ($195; keyboard needed;) 
Syncrtek Systems (who also make SYM), Box 552, 
Santa Clara, CA 95052 (408) 988-5600 ($389 - $450 
coinplete); 

Riverside Electronics Design, 1700 Niagara St., 
Buffalo, N.Y. 14207 (716) 875-7070 ($225 A & T; 
keyboard needed; $150 complete kit including 
keyboard.) 

Netronics R&D, Ltd., 333 Litchfield Rd., New 
Milford, CT 06776, (800) 243-7428 ($149.95 + $3 
postage.) 

After much looking and reading, and several long- 
distance telephone calls, I chose the "Stand Alone 
ASCII/Baudot Computer Terminal" by Netronics R 
& D, Ltd. This unit will provide 64 or 32 characters 
per line - 64 for TV direct or video monitor, and 32 
for use with a modulator and plain TV. The baud 
rate is 110 or 300 ASCII, 45.45 or 74.2 Baudot. 
Output is either RS232 or 20 ma current loop (TTY 



"similar"). All printable ASCII characters are 
available (upper and lower case) as well as 32 special 
characters (Greek letters, symbols, superscripts, and 
graphic characters). 

Complete cursor control is provided, including 
absolute and relative X - Y addressing. This allows 
low-resolution graphics and cotnputed relative cursor 
jumps. At 300 baud you cannot do animation. 

The Netronics video board has an on-board 
+ 5V regulator, and draws about 450 ma. If it is 
used with their keyboard, you supply + 8VDC (or 
-I-5VDC) at 500 ma and 6.3VAC at about 50 ma 
(most keyboard inverter chips require -12V DC; the 
Netronics circuit eliminates the need for this supply. 
It uses a voltage doubler to convert the 6.3VAC to 
-12VDC for the keyboard encoder chip and the 
RS232 I/O levels.) 

The video board mounts underneath the 
keyboard and both fit into the Netronics $20 
keyboard case, leaving room for the necessary 
transformers and capacitors. When the keyboard and 
the video board are assembled and housed in the 
case, they provide full ASCII or Baudot input with 
some interesting extras, and everything needed for 
the output display except a monitor. 

The Netronics documentation is a little on the 
light side; nevertheless, assembling the kit should be 
relatively easy for anyone with kit-building ex- 
perience. The copper traces and pads are very small, 
so a small-tip, low-wattage soldering iron is a must. 
Take your time, and inspect each of ihc more than 
1000 joints for proper solder flow and absence of 
solder bridges. There are many plated-through 
jumper holes in the board, and it is easy to insert a 
component in the wrong hole. The component 
numbers are marked on the board, but the jumper 
holes do not have a silkscreened outline around them 
as Heathkit boards do. If you have any doubt about 
the proper placement of a component, trace the 
schematic and follow the foil traces. (The first-time 
kit builder is advised to get some expert supervision 
in positioning the components. It's tiiscouraging to 
have to back up.) 

A good photograph showing correct placement 
of components on a completed board should be in- 
cluded with the documentation, but is not. The kit 
does not include an RS232 connector. 

My group of five electrical engineers built 9 of 
these terminals. Five of the boards failed to work at 
fu-st because of poor solder joints or misplaced 
jumpers. One board had a bent IC pin, and one had 
3 Jumpers missing. One, assembled by a good 
solderer with a known good board for reference, 
worked the first time it was hooked up, 

A few modifications to the board might be con- 
sidered. If you replace jumper SlO with a normailv 
closed pushbutton switch, you can generate (he 
BREAK command like a TTY. 

Put a SPOT switch in place of J3-J4 on the 
keyboard, and you can switch easily between aii-caps 



■-<i 



A BRILLIANT FUTURE FOR YOUR AIM-65 WITH THE BANKER MEMORY 



"Tie* 



m 






^*. j^r 







:t^ 



«.'■ 






% 



^*." " Your 36K of free address 

■' ■ space is the AIM'S most 

''*% * valuable and limited re- 

vO*' .V,* ' source. With today's large 

/>'^i:7" capacity RAM boards, ROM 

!l • 7^ boards, disk systems, video 

boards, and other expansion 

* accessories it is easy to deplete 

• . this resource before the appliea- 

• - ' tion requirement is satisfied. MTU 

'""j . . has solved this problem. 

THE BANKER MEMORY contains 32K of RAMr4 PROM sockets for 2716/2732/2332, a PROM programmer, 40 bits of parallel 
I/O, and 4 timers from two 6522 I/O chips. Addressing is extremely flexible with the RAM independently addressable in 4K 
blocks, PROM'S independently addressable, and I/O addressable anywhere on a 64 byte boundary (even in AIM'S I/O area at, 
/kXXX by adding a single jumper to the AIM). 

This may sound familiar, but read on! Unlike other AIM compatible memory boards, THE BANKER MEMORY has on-board bank- 
switching logic! The four 8K blocks of RAM plus the 4 PROM sockets make up 8 resources, each associated with a bit in an 
Enable Register. Through this Enable Register resources may be turned on and off under software control. When a resource is 
off its address space is freed for other uses. You can even put BANKER resources at the same address and switch among them 
for' virtually unlimited RAM and PROM expansion! You can even have multiple page zeros and stacks! Do you need 1 60K byte of 
memory? It only takes 5 of THE BANKER MEMORY boards and you end up with 5 page zeros and stacks to boot! 

There's morei The BANKER MEMORY also incorporates 18 bit addressing which allows for the 256K address spaces of the 
1 iisiisio . V y . , ,„ . , .. ...I, ^ o u;i. „^^,nr.« ^n^nrtar- »ih!/~h aiirn«/o thecp rcieni irnes tn he in different 64f\ 



ZS^'S^aJdTndTh M^^^^^^^^^ 

DMA RAM, can turn your AIM into a truly powerful 6502 computer that far surpasses the packaged systems in functional 

[INTRODUCTORY SPECIAL K-1032-1 32K BANKER MEMORY FULLY ASSEMBLED AND TESTED $395.00 ($450.00 as of 
March 1, 1980) or the K-1 032-2 16K RAM only with bank switching and 18 bit address bus only $295.00 
Isn't it time you took a closer look at MTU - we offer you power now with an eye to the future. 

WRITE OR CALL TODAY FOR OUR 48 PAGE FALL 1980 6502 CATALOG 
- -- • ■ -^ ~ — International requests include $1.00 

VISA and MASTERCARD accepted 




Photo credit: 
SUPERNOVA CRAB NEBULA: 

Patomar Observatory, 
California Institute of Technology 



Micro Technology Unlimited 

' Z806 Hillsborough Street 

P.O. Box 1Z1Q6 
' Raleigh, NC 27605. U.S.A. 
1919)833-1458 — _-^-.,-- 



132 



COMPUTE! 



Februory, 1981, Issue 9. 



with numbers (TTY mode) and typewriter mode, 
with both upper and lower case. When you are 
writing or running programs in BASIC you will pro- 
bably find the all-caps mode most convenient. If you 
intend to do any word processing, you will find that 
ability to change easily to upper or lower case is very 
helpful. 

If you think you may want to change from 
RS232 to 20 ma loop, install a SPDT toggle switch 
at Sll, and a DPDT switch at S12. One pole of tog- 
gle switch S12 should be in series with R12, and the 
other replaces jumper SI2. These switches permit 
you to change from one system to the other without 
changing 6 jumpers. (Fig. 1). For RS232, set switch 
Sll to position B, close Si 2, and use pins 2 and 3 
for I/O. For 20 ma current loop, set switch Sll in 
position A, switch S12 open, and use pins 24 and 25 
for I/O. Jumpers S8, S9, and SIO are installed as 
shown. 



GND 



20MA IN Jl-25 
RS232 IN .Jl-2 



4= CI 8VDC 




RS232 1 J 1-20 

HANDSHAKE^ \\'l 

LINES J ji.a 



RS232 OUT Jlv) 

CURRENT Jl-23 
SOURCE 

20MA OUT J 1-24 




7 S12. 2PDT 
X SWITCH 



SWITCHES SHOWN IN 20 MA POSITION 

I/O MODIFICATION FIGURE 1 



Other lines in Jl will have to be connected to 
your terminal, but different computers and terminals 
may require different lines. KIM has a 20 ma cur- 
rent loop I/O, but the input to the terminal needs to 
be inverted. Set Switch Sll to Position B, and open 
Switch SI 2. Wire KIM A-1 to Netronics JI-1, KIM 
A-T to Netronics J 1-24. Jumper KIM A-S (S acts as 
a current source) to A-U and wire A-U to Netronics 
Jl-25. (You can use Netronics Pin J-1 jumpered to 
J 1-25 as a current source; if you do this, then do not 
use KIM A-S.) 

You could make a simple RS232 adapter for 
KIM to talk over, but that is another story. Pins 
Jl-1-5, 6, 8, 17, and 20 are handshake lines for talk- 
ing to a modem, and will not be used by KIM. 

The power supply shown in Fig. 2 may not be 
ideal, but it works and fits inside the keyboard case. 



117 VAC 




G.3 VAC 



POWER SUPPLY 



FIGURE 2 



PARTS LIST 

Tl Transformer 6.3 VAC ® 1.2 A Radio Shack #273-050 $3.49 
T2 Transformer 6.3 VAC @300 ma Radio Shack #273-1384 2.49 
Dl Diode bridge, 1 A, 50 PI V Radio Shack #276-1161 .79 

6 Capacitor, 3300 uf, 35V Radio Shack #272-1021 2.99 

The Netronics kit has a few bad features. One is the 
lack of enough detail in documentation. The next 
may be only a personal idiosyncrasy, but I strongly 
prefer to use a complete set of IC sockets; Netronics 
provides sockets only for the 24- and 40-pin IC's. 

I wish they had provided an RS232 chassis con- 
nector -- perhaps even as an option -- so I wouldn't 
have had to order one from another company. 

The printed circuit board for the Netronics 
keyboard is a little flimsy for key pounding. If it is 
mounted properly it is perfectly OK, but the 
mounting instructions are included only with the op- 
tional case, not with the keyboard itself. 

There is no line feed key; Control J yields a line 
feed. If your computer echoes a line feed when you 
send it a carrige return, you're okay; otherwise you 
have either a programming problem or a minor pain 
in the neck. 

No serial video board I have seen -- Netronics 
included — has high-resolution graphics like a 
memory-mapped video board. This could be pro- 
vided with a RAM character generator, but it really 
isn't expected at this low price. The Netronics 20 ma 
current loop is not isolated like the Xitex, and so 
may not work well with some devices. It does not 
work well with all the devices I have tried, including 
FLAOS systems. 

Granted these deficiencies, why am I glad I 
bought the Netronics? To summarize: 

Quick delivery via an 800 phone number and credit 
card. 

Complete cursor control. 

TTY mode, with upper/lower case eaisly available. 
The full ASCII character set plus the Greek 
alphabet, other characters, and some graphic sym- 
bols. 

Shift lock, control key, and escape key. 

A true delete key (Some delete keys only back up the 

cursor; this one also erases the unwanted character.) 

The board works directly with my KIM TTY 

monitor ROM - no special software support. 

My KIM now has a video terminal which cost less 

than the KIM. It is a complete, working terminal 



February, 1981, Issue 9. 



COMPUTE! 



133 



which will talk not only with KIM but also with 
time-sharing systems anywhere. I consider it a very 
efficient and cost-effective means of obtaining ASCII 
input/output for any of the four KAOS systems. 

Given the delay between writing and publica- 
tion, by the time you read this there may be 
something better and/or cheaper on the market. These 
comments should help you to analyze the data sheets 
and schematics. I can testify that a careful kit- 
builder, in a few evenings of work, can put together 
a very attractive and efficient terminal at a very 
reasonable price. ® 



• ••••••••••••••**************^***j 



« 

*\ 
■♦cl 

* 

* 
* 



M 



M 



M 



M 



END FRUSTRATION!! 



FROM CASSETTE FAILURES 

PERRY PERIPHERALS HAS 

THE HDE SOLUTION 



* OMNIDISK SYSTEMS (5" and 8") 

* ACCLAIMED HDE SOFTWARE 
■^ • Assembler, Dynamic Debugging Tool, 

♦ 

Memory Test 



Text Output Processor, Comprehensive 



* 
% 



• Coming Soon— HDE BASIC 

PERRY PERIPHERALS S-100 PACKAGE 

Adds Omnidisk (5"} to 
Your KIM/S 100 System 
I Construction Manual— No Parts 



*• FODS & TED Diskette 

*• $20. +$2. postageSt handling. (NY residents 

J add 7% \an\ (specifv for 1 or 2 drive system) 

* 
* 

* 



Place your order with: 
PERRY PERIPHERALS 

P.O. Box 924 
Miller Place, N.Y. 11764 
(516) 744-6462 

Your Fiill-Line HDE Distributor/Exporter 



* 
I* 

♦ 
* 

* 
* 

* 
* 
* 

* 
* 
* 
♦ 

♦ 



• *-*••**••*■••****•*•**••••*■*■■*•*■•** 



Compare Our Prices With Any Others 



Rockwell's 


AIM-65 


1K System: 


$405. 


4K System 


$459 


Synertek's 


SYM-1 


IK System: 


235. 


4K System 


259 


Commodore's 


KIM-1 


IK System: 


175. 







FOR YOUR SYSTEM'S EXPANSION 



$279. ProtoPlusIl 


$42 


375. ASK 1/0 Board 


55 


279. DRAM & Video Cable 


15 


115. Power Supply for SYM-1 


39 


i Enclosure for AlM-65 $119. 




d Enclosure for KlM-1 65. 





The Computerist, Inc's: 

16K DRAM 

32KDRAM 

Video Plus II 

Mother Plus II & Card Cage 



All products are factory warraritied. Prices include full documentation. 

Send Check or Money Order to: 

Hepburn MCA 

12 Grosvenor Street 

Lowell, MA 01851 

Please add $5.00 shipping and handling. MA residents add 5% sales tax. 
* Mini Computers and Accessories 



134 



COMPUTEI 



February. 1981 Issue 9. 



SYMple Clock 

A. M. MacKay 
Owen Sound, Ontario 

There are lots of clock programs around, but this one 
is a little different, and a lot more useful than most. 
It is written for a SY.M-l with 4rK memory, but will 
work with a bare board. It is similar in some ways to 
the one in Issue I of Compute II, but doesn't require 
Basic or a CRT. 

While most clock programs using the LED 
readouts won't do anything else while the clock is 
running, this one sits at the top of your memory, out 
of the way of most programs, and quietly ticks away 
while you and your SY.M do other and better things. 
But when you want the time, either visually or for 
use by a program, just call it and there it is. 

Since a program such as this will likely be stored 
on tape and loaded when required over the years, no 
page zero slots arc used so you don't have to 
remember or keep track of them. 

The clock runs in 24 hour format. If you prefer 
12, change location OFAB to 12. Then to start the 
clock, enter the hours, minutes and seconds, with fif- 
teen or twenty seconds lead time, into locations 
OFFD, OFFE and OFFF respectively. Then enter 
"GO F3F'* and at the exact second hit "CR" and 
presto! Nothing happens! Ah, but it does. Your clock 
is running, quietly minding it's own business, eager- 
ly awaiting your summons. Now, to see the time, all 
you do is hit "SHIFT CALC CR" or "SHIFT 
CR" or any other "UNRECOGNIZED" command. 
The time will be displayed for a few seconds, then 
the readouts will be blanked except for a row of dots. 
As soon as you see the dots, you can go back to 



whatever you were doing with your SYM. If you 
want the time displayed during, and as part of, a 
program, just use "JSR B9 OF" and there it is. 

Most importantly, though, if you want the time 
for controlling purposes, just call it at OFFD, OFFE 
and OFFF with your program. It can, at the proper 
time, sound an alarm, turn off the lights, turn on 
your lights, and/or whatever makes you happy. 

If you don't want clock time, bul just the time 
since your SY.M was turned on (actually since the 
clock started), don't enter anything in OFFD-F. Just 
hit "GO F3F CR" and the clock will automatically 
start at 00 hours 00 minutes 00 seconds. 

If your SYM is new, this is a good chance to ex- 
periment, changing things to suit your purposes. For 
example, try moving "DLY" from line 1090 to line 
1010 (change "EB" to "D4" at location OFEA). 
Your SYM now looks like a cheap digital clock. Now 
try changing "OA" at location 0FD2 lo "lA", then 
move lines 1070 and 1080 to a new location between 
lines 1000 and 1010. Do you prefer the display this 
way? 

The theory of operation is similar to that given 
for my clock article in Compute II no. 1, which re- 
Cjuired Basic and a CRT. However, the program is 
somewhat different because the clock in that article 
kept time in hex, while this one keeps time in 
decimal. To work in decimal with "SED" you must 
use ADC or SBC. "INC" just doesn't work. 

Your SY.M-l is very powerful by itself, and is 
the basis for an extremely complex and powerful 
system. To get the most from it, I urge you to join 
the SYM-1 Users' Group, P.O. Box 315, Chico, CA 
95927. And, of course, subscribe to and keep reading 
COMPUTE! 



Q005 
0010 
0020 
0030 

ooao 

0050 
0060 
0070 
008D 
0090 
0100 
0110 
0120 
0130 
OUO 
150 
0160 
0170 
0180 
0190 
0200 
0210 
0220 



.OS 



««* 

««« 
**» 
*«* 
«*« 
*»* 
««« 
«** 
* «■ * 



SYMPLE 



CLOCK < < < 



# -R- ■» 
»«* 
» *« 

♦ *# 
»*# 
*« «■ 



.BA $0F3F 
* * ♦ DEFINITION OF LABELS * * » 



BY A. K. MACKAY 
CO-OHDZNATOR* SURVEY DEPT. 
GEORGIAN COLLEGE A.A.T. 
1150 EIGHTH STREET EAST 
OWEN SOUND J ONTARIO CANADA 
N4K 5R^ JUNE 16j 19b0 



OUTBYT 

SCAND 



.DE $d2FA 
-DE S8906 



February, 1981, Issue 9. COMPUTE! 135 



FACTORY PRICING 

IN STOCK! IMMEDIATE DELIVERYI 



^APS 6500 



'^^ PLUS 



• MPS 6550 RAM for PET 

• MPS 6530-002, -003 for KIM-1 

• MANUALS 

• KIM-1 MICROCOMPUTER 

• KIM-3 8K STATIC RAM MEMORY BOARD 

• KIM-4 MOTHERBOARD 

• KIM PROMMER 

KIM-1 & 4 Compatable Eprom Programmer 

• KIMATH 

Chips with Listing 

• KIMEX-1 EXPANSION BOARD 

KIM-1 Plugcble PROM, Ram and I/O Board 

• RS-232 ADAPTER 

For KIM-1 

• POWER SUPPLIES 

STANDARD MICROSYSTEMS 

• UART's •FLOPPY DISC DATA HANDLER 

• BAUD RATE GENERATORS •CRT CONTROLLERS 



FALK-BAKER 
ASSOCIATES 



382 FRANKLIN AVE • NUTLEY, NEW JERSEY 07110 
(201) 661-2430 

WRITE, CALL OR RETURN OUR COUPON FOR CATALOGUE AND PRICE LISTS. 



136 



COMPUTE! 



FeDruory, 1981 Issue 9 











0230 


ACCESS 










0240 


IFR2 










0250 


DISBUF 










0260 


UHGVEC 










0270 


IRQVEC 










0280 


CLRINT 










0290 


TICH 










0300 


TILL 










031 


ACR 










0320 


IFR 










0330 


lER 










0340 


J 










0350 


J 










0360 


) 


0F3F- 


20 


86 


6B 


0370 


START 


0F42- 


A9 


71 




0380 




OFAA- 


8D 


7E 


A6 


0390 




0F47- 


A9 


OF 




0400 




0F49- 


8D 


7F 


A6 


0410 




0F4C- 


A9 


B9 




0420 




OF^E- 


8D 


6D 


A6 


0430 




0F51- 


A9 


OF 




0440 




0F53- 


8D 


6E 


A6 


0450 




0F56- 


A9 


CO 




0460 




0F58- 


SD 


08 


AC 


0470 




0F5B- 


SD 


OE 


AC 


0480 




0F5E- 


AD 


OD 


AC 


0490 




0F61 - 


29 


BF 




0500 




0F63- 


8D 


OD 


AC 


0510 




0F66- 


A9 


50 




0520 




0F68- 


8D 


06 


AC 


0530 




0F6B- 


A9 


C3 




54 




0F6D- 


8D 


05 


AC 


0550 




0F70- 


60 






0560 

0570 
0580 
0590 


J 


0F7I- 


48 






60 


CLOCK 


0F72- 


F8 






0610 




0F73- 


CE 


FC 


OF 


0620 




0F76- 


DO 


3B 




63 




0F78- 


A9 


U 




0640 




0F7A- 


8D 


FC 


OF 


0650 




0F7D- 


18 






0660 




0F7E- 


A9 


01 




0670 




0F80- 


6D 


FF 


OF 


0680 




0F83- 


8D 


FF 


OF 


0690 




0FS6- 


C9 


60 




0700 




0F88- 


DO 


29 




0710 




0F8A- 


a9 


00 




0720 




0F8C- 


8D 


FF 


OF 


0730 




0F8F- 


18 






0740 




0F90- 


A9 


01 




0750 




0F92- 


6D 


FE 


OF 


0760 




0F95- 


8D 


FE 


OF 


0770 




0F98- 


C9 


60 




0780 




0F9A- 


DO 


17 




0790 




0F9C- 


A9 


00 




0800 




0F9E- 


8D 


FE 


OF 


0810 




OFAI- 


18 






0820 





.DE 


S8B86 


.DE 


SA405 


.DE 


£A640 


.DE 


SA66D 


.DE 


$A67E 


.DE 


SAC04 


.DE 


SAC05 


.DE 


SAG 6 


.DE 


SACOB 


.DE 


SACOD 


.DE 


SACOE 



;FLAG for DISPLAY TIMER 



* * • INITIATE TIMER * * * 



JSR 
LDA 
STA 
LDA 
STA 
LDA 
STA 
LDA 
STA 
LDA 
STA 
STA 
LDA 
AND 
STA 
LDA 
STA 
LDA 
STA 
RTS 



ACCESS 
i'L^CLOCK 

IRQVEC 

#H^CLOCK 

IRGJVEC + 1 

#L/TIME 

UHCVEC 

#H^TIME 

URCVEC + 1 

#aco 

ACR 

lER 

IFR 

#£BF 

IFR 

#S50 

TILL 

#SC3 

TICK 



;urv'WRlTE PROTECT SYS RAM 

iSET IRQ 

; VECTOR 

: TO 

! "CLOCK" 

ISET UNRECOGNIZED 

; COMMAND VECTOR 

I TO 

! "TIME" 

ISET BITS 6 A 7 

; FOR FREE RUNNING MODE 

; AND Tl INTERRUPT ENABLE 

;CLEAR Tl FLAG BIT 6 BUT 

I DON'T DISTURB OTHER 

! IFR BITS 

tSET 

; TIMER 

: FOR 



1/20 SEC AND 



START TIMER 



* * * INTERRUPT SERVICE ROUTINE * * * 



;SAVE ACCUMULATOR 

;TIME IS IN DECIMAL MODE 

JSEE IF 1 SEC HAS PASSED 

;1F NO^ EXIT 

;IF YES/ 

; RESTORE COUNT 

; AND 

J ADD 1 

TO 
» SEC S 

;SEE IF 60 SECS HAS PASSED 

;iF koj exit 

;IF YES> RESET 

SECS TO ZERO 
i AND 

f ADD 
; ONE TO 

; MI NS 

;SEE IF 60 MINS HAS PASSED 
;IF NO^ EXIT 
;IF YES^ RESET 
' MINS TO ZERO 
! AND 



PHA 


J 


SED 


J 


DEC 


COUNT 


BNE 


EXIT 


LDA 


#20 


STA 


COUNT 


CLC 


• 


LDA 


#01 


ADC 


SECS 


STA 


SECS 


CMP 


#£60 


BNE 


EXIT 


LDA 


#00 


STA 


SECS 


CLC 


• 


LDA 


#01 


ADC 


MINS 


STA 


MINS 


CMP 


#S60 


BNE 


EXIT 


LDA 


#00 


STA 


MINS 


CLC 


Jf 



Febfuarv, 1981 


Issue 9. 








COMPUTE! 




137 


0FA2- 


A9 1 




0830 




LDA *0 1 


; ADD 


0FA4- 


6D FD 


OF 


0840 




ADC HOUR 


ONE TO 


0FA7- 


8D FD 


OF 


0850 




STA HOUR 


; HOUR 


OFAA- 


C9 2ii 




0860 




CMP #£24 


;SEE IF 24 HOURS HAS PASSED 


OFAC- 


DO 05 




0870 




BNE EXIT 


;IF NO^ EXIT 


OFAE- 


A9 




0880 




LDA #00 


;IF YES/ RESET 


OFBO- 


BD FD 


OF 


0890 




STA HOUR 


; HOUR TO ZERO 


0FB3- 


AD OA 


AG 


09OO 


EXIT 


LDA CLR I NT 


J ENABLE TIMER INTERRUPT 


0FB6- 


D8 




0910 




CLD J 


;BACK TO HEX 


0FB7- 


68 




Q920 




PLA ; 


;REST0RE ACCUMULATOR 


0FB8- 


AO 




0930 
0940 


J 


RTI 










0950 


* 


* * DISPLAY 


ROUTINE * * » 








0960 


* 






0FB9- 


2 86 


SB 


0970 


TIME 


JSR ACCESS 


;UNWRITE PROTECT SYS RAM 


OFBC- 


^8 


^ 


0980 




PHA ; 


;SAVE ACCUMULATOR 


OFBD- 


8A 




0990 




TXA ; 


; AND 


OFBE- 


48 




1000 




PHA J 


; X-REGI5TER 


QFBF- 


AD FD 


OF 


1010 




LDA HOUR 


;PUT 


0FC2- 


2 FA 


82 


1020 




JSR OUTBYT 




0FC5- 


AD FE 


OF 


1030 




LDA MINS 


; TIME ON 


0FC8~ 


2 FA 


82 


1040 




JSR OUTBYT 




0FC3- 


AD FF 


OF 


1050 




LDA SECS 




OFCE- 


2 FA 


82 


1060 




JSR OUTBYT 


; DISPLAY 


OFDl - 


A9 OA 




10 70 




LDA #SOA 


;SET NUMBER OF 


0FD3- 


8D FB 


OF 


1080 




STA CNTl 


TIMEOUTS FOR DISPLAY 


0FD6- 


A9 FF 




1090 


DLY 


LDA #SFF 


;SET LENGTH OF 


0FD8- 


8D IF 


A4 


1 100 




STA £A41F 


; TIMEOUT 


OFDB- 


20 06 


89 


1110 


DISPL 


JSR SCAND 


;light leds 


OFDE- 


AD FA 


OF 


1 120 




LDA MASK 


;CHECK TIMER 


OFEl- 


2C 05 


A4 


1130 




BIT IFR2 


; IRQ 


0FE4- 


10 F5 




1 140 




BPL DISPL 


J IF NO IRCj repeat 


0FE6- 


CE FB 


OF 


1 150 




DEC CNTl 


;el5e start again 


0FE9- 


10 EB 




1 160 




BPL DLY 


/•FINISHED? 


OFEB- 


A2 5 




1170 




LDX #S0 5 


; CLEAR '1 


OFED- 


AD FA 


OF 


1 180 


CLR 


LDA MASK 


X : DISPLAY r 1 ^ 


OFFO- 


9D 40 


A6 


1 190 




STA DISBUF^ 


0FF3- 


CA 




1200 




DEX 


' ^■ 


0FF4- 


10 F7 




1210 




BPL CLR 


J 


0FF6- 


68 




1220 




PLA ; 


; RESTORE 


0FF7- 


AA 




1230 




TAX ; 


; X-REGISTER AND 


0FF8- 


68 




1240 




PLA ; 


ACCUMULATOR 


0FF9- 


60 




1250 
1260 


} 


RTS 










1270 


i * 


* * STORAGE 


DEFINITIONS * * * 








1280 


i 






OFFA- 


80 




1290 


MASK 


.BY XIQOOOOOO ;BIT 7 ONLY 


OFFB- 






1300 


CNTl 


.DS 1 




PROVIDE SPACE FOR CNTl 


OFFC- 


14 




1310 


COUNT 


.BY 20 




SET COUNT TO 20 


OFFD- 


00 




1320 


HOUR 


.BY 




(START TIME AT HOURS 


OFFE- 


00 




1330 


MINS 


• BY 




\ MINUTES 


OFFF- 


00 




1340 


SECS 


.BY 00 




; SECONDS 








1350 




.EN 




LABEL 


FILE: 


[ 


/ = EXTERNAL ] 














/QUT3YT=e2FA 


/5CAND=6906 /ACL 


tSS=aiia6 










/:7R2=AHIi5 


/DlS3UF=A6ilO /URCVEC=fi66D 










/1R5UEC=!A67E 


/CLfilKT=ACOil /T1CH=AC05 










/TILL^ACOS 


/flca=ACOB nff 


i-Acgi> 










/lER^fiCOE 


START=0F3F CL(Xh = (lF7l 










EXIT=0FS3 


TIKE=0FE9 OVf 


= 0FD6 










Di5PL=0FDB 


CLRsOFED l-iASi 


<-l)FFA 










CNTl'OFFB 


COUHT=[JFFC HDUa = OFFD 










MiKS = l)FFE SECs'OFFF 
//QDDO/ IOIia< HDD 





138 



COMPUTE! 



Febfuorv. ITOl Issue 9 



Expanding 
KIM-Sfyle 
6502 Single 

BO'QrCl Hal Chamberlin 

Computers 

Editor's Note: Hal ended his first installment with this ■ ■ ■ 

*'The rml question at this funnt that u; Haw many sxpansion boards 
can the unbuffered mkwpTocessor bus drive before becoming overhtaded? The 
6502 TiMCTopwctisoT IS rated to drive slightiy more than I standard ITL 
toad (equiiaUjil to five low power shottky loads) on its addreis and data 
busses while most rf the ItAM's and ROM's tied to the data bus can drive 
two standard TTL loads, lie 6520, 6522, and 6530 I/O chips have the 
same drive capability as the microprocessor. Thus in general the answer is 
at least four boards provided that the expansion boards ihamelves buffer the 
bus such that only one low power shottky load (.36MA in the zero state) is 
presented to the bus by the board Many boards on the market and par- 
ticularly those designed for an unbuffered bus do this. Actually, any well 
designed board would be expected to buffer the bus in order to provide clean 
signals for the remainder of the board logic. The reason thai only four 
boards can be driven instead of five is thai some of the address lines are 
loaded by a low power Shottky decodtr IC on the computer board itself 

Part 2 of 3 

The Great Experiment 

Of course loading the microprocessor wiih a full five 
loads puts the system right at the limit of rated drive 
current. One of the problems with testing digital cir- 
cuitry is that there is no obvious indication of 
marginal operation that may later develop into a full 
fledged failure as components age. In order to deter- 
mine the actual drive limit, the author took a fully 
stuffed AIM-65 (4K on-board RAM, assembler 
ROM and BASIC ROM^s) and started adding 
Micro Technology K-1016 16K memory boards, the 
idea being to add boards until failure due to bus 
overload occurred. These boards use low power Shot- 
tky buffers onboard so each one would be expected to 
add a .36MA load to the bus. 

Since the AIM's 40K of free addresses would 
only accomodate two of these boards, the most 
significant address bit was cut away from the bus at 
each socket position and instead connected to parallel 
output bits on the AIM's application connector. The 
boards were then jumpered to respond to addresses 
between 2000 and 5FFFF (hex). By programming 
only one output bit to be low at a time, a rudimen- 
tary bank switching setup was impletnented. When 
the system was reset, all output bits automatically go 
high thus disabling all of the boards and preventing 
interference with (he AIM monitor (since A15 was 
ignored, an enabled board would also respond to 
AOOO-DFFFF). A proper bank switch setup would 
have required a two-input OR gate (negative AND) 
to be tied to each of the A15 pins. In any case, it 
was adequate to run a memory test program. 



The first trial was to install 4 of the 16K boards 
which worked fine as expected. Next, another card 
file was placed below the first and jumper wires 
added between the two motherboards. This gave a 
total of 9 bus slots which were filled with 16K. 
memory boards. Again the memory test program 
(which wrote all 144K of memory with random data 
before reading any of it back) indicated no problem 
and the AIM monitor and BASIC continued to work 
flawlessly. A check with an oscilloscope revealed 
minimal signal degradation. 

Finally, a third card file was added and bus 
jumpers installed to give a total of 14 slots. Three 
additional 16K memory boards were scrounged (I 
had no idea that more than 9 or 10 boards could be 
driven) to give a total of 192K of RAM. Again there 
were no obvious problems and the bus was being 
loaded to three times rated capacity! Figure 3 shows 
what the stack of card files looked like which is 
obviously impractical unless one cuts a hole in the 
tabletop to let the two extra card files hang below (I 
simply sat on a drafting stool to use the systein). The 
rear view in figure 4 shows the interconnected 
motherboards and individual Board Enables from the 
application ccmnector. Note the gridwork of copper 
braid between motherboards which makes the 
groundplane essentially continuous between the 
motherboards. 

Photographs of the address and data bus signals 
were taken while running the memory test program 
and arc shown in figure 5. About the only visible 
loading effect on the address bus is a long tail on the 
zero-to-one transition during phase 1 of the clock. 
The data bus appears to be even cleaner with just a 
shade over lOONS required for the data to stabilize 
afier the leading edge of phase 2. The microprocessor 
was driving the data bus for the data bus for this 
photo (scope synced to read/write line on the bus). 
The zero logic levels, which one would think show 
the effect of gross overloading most, were still in the 
0.3 volt range although the one levels were down to 
only 3 volts from a normal lightly loaded value of 
nearly 4 volts. Note the almost complete absence of 
noise. These "overloaded" signals actually look far 
better than most S-IOO bus signals! 

While these results are encouraging and certain- 
ly show that a four board load does not bring a 
system to the brink of failure, it does not mean that 
loading rules can be disregarded altogether. Some 
AIM'S, as well as SYM's and KIM'.s, can be ex- 
pected to have a weak component on-board that may 
not be able to drive a 12 board load adequately for 
reliable operation. Thus the "official" recommenda- 
tion is to stick with the spec book and limit unbuf- 
lered systems to four boards. However, individual 
hobbyists should be able to go one or iwo boards 
over the limit with little probability of problems. Ac- 
tually, addressing limitations arc more likely to limit 
system size than bus drive capability with today's 
dense boards. 



February, 1981. Issue 9. 



COMPUTE! 



139 




FIG.3. FRONT VIEW OF 192K RAM TEST SYSTEM 




FIG. 4. REAR VIEW OF 192K TEST SYSTEM 
SHOWING MOTHERBOARDS WIRED TOGETHER 



* ADDRESS 
I BUS 




FIG. 5. BUS SIGNAL WAVEFORMS IN iy2K TEST 
SYSTEM. TOP WAVEFORM IN EACH PHOTO IS 
PH.\SE 2 CLOCK. a 



6502 FORTH 

6502 FORTH is a complete programming system which 

contains an interpreter/compiler as well as an 
assembler and editor. 
I 6502 FORTH runs on a KIM-1 with a serial terminal. 

(Terminal should be at least 64 chr. wide) 

► All terminal I/O is funnelled through a jump table near 
the beginning of the software and can easily be 
changed to jump to user written I/O drivers. 

► 6502 FORTH uses cassette for the system mass storage 
device 

► Cassette read/write routines are built in (includes 
Hypertapc). 

» 92 op-words are built into the standard vocabulary. 
Excellent machine language interface. 
6502 FORTH as user extensible. 

6502 FORTH is a true implementation of forth according 
to the criteria set down by the forth interest 
group. 
• Specialized vocabularies can be developed for specific 

applications. 

t 6502 FORTH resides in 8K of RAM starting at S2000 and 
can operate with as little as 4K of additional 
contiguous RAM. 



6502 FORTH PRICE LIST 

KIM CASSETTE, USER MANUAL, AND 
COMPLETE ANNOTATED SOURCE 
LISTING S90.00 

($2000 VERSION) PLUS S&H 4.00 

USER MANUAL (CREDITABLE 
TOWARDS SOFTWARE 
PURCHASE) $15.00 

PLUS S&H 1.50 

SEND A S.A.S.E. FOR A FORTH 
BIBLIOGRAPHY AND A COM- 
PLETE LIST OF 6502 SOFTWARE, 
EPROM FIRMWARE (FOR KIM, 
SUPERKIM, AIM, SYM, and 
APPLE) AND 6502 DESIGN 
CONSULTING SERVICES 
AVAILABLE 

Eric Rehnke 

1067 Jadestone Lane 

Corona, CA 97120 



Now Available For 
KIM, AIM, And SYM 



MO 



COMPUTE! 



Februory. 1981. Issue 9 



Load And 
Save 

KIM BASIC 
Programs 
On Your SYM 

George Wells 
LoVerne, CA 

The SYM and KIM microcomputers are close 
cousins. Their hardware and tape interface com- 
patibihties are well known. Not so well known is the 
fact that the BASIC interpreters on the two systems 
use the same tokens for their reserved keywords 
which makes transfer of BASIC programs between 
the SYM and KIM almost trivial. 

Mike Hanna, a friend of mine who has had a 
KIM with BASIC for much longer than I have had 
my SYM with BASIC, has offered to share his 
library of BASIC programs with me. We had con- 
sidered implementing a telephone/modem interface to 
accomplish this transfer but after comparing the 
disassembly listings of the two interpreters we decid- 
ed a tape transfer would be easier. The scheme we 
finally settled on allows the SYM to create and read 
tapes in the original low speed KIM format since the 
SYM does not support any of the faster versions. 
Going from the SYM to the KIM is particularly sim- 
ple; going the other way requires a short BASIC pro- 
gram (see listing). 

SYM To KIM Transfer 

STEP 1: Load the BASIC program to be transferred 

into the SYM. 

STEP 2: Exit BASIC and return to the Monitor {by 

way of reset, for example). 

STEP 3: Determine the end of the BASIC program 

by examining the two-byte pointer stored at $7D/S7E 

by entering .V 7D-7E. The SYM will respond with: 

007D uv wx,yz 

where wxuv is the end of the program (qrst) plus 

one. The monitor will calculate qrst for you if you 

can't do it in your head by entering .C wxuv-l. 

STEP 4; Save the program on tape in KIM format 

by entering: 

.SI 1,201-qrst 

where qrst is the value from STEP 3. 

STEP 5: Load the program into KIM BASIC in the 

normal manner. 



KIM To SYM Transfer 

In order to load KIM formatted BASIC programs in- 
to your SYM you will need to have a copy of the 
KIM BASIC PROGRAM LOADER listed with this 
article. Save this program on tape (in high speed for- 
mat, of course) so that you will have ii whenever you 
need it. NOTE: This program will noi work with 
Monitor Version LO which has an error in the KIM 
Load routine. 



LIST: REM 



KIM EFlSIC PPDGRFII1 LDflDER 



100 ft=iJiR<i"8ES6"> a> 

n (I fl=4i57ei PDK:E R.I: poke fl+l.£: POKE ft+2,£55 
ISO FDR 1=0 TO £9 
130 POKE 3 00+1, PEEK C55'3SCi+I> 
140 HEX! 1 
150 POKE 330.96 

160 PRIMT "flFTER 'LDftlJED- MEiSFiGE, EMTER:" 
1?0 PfilMT "POKE ia5.P£EK<£54j: POKE 126, PEEK .:e=5'5-. 
130 PfilMT USP<:300,)!,"C6C5",&:"8Cf(C",Oi 
DK 



CLEHHP" 



STEP 1: On the KIM, save the program to be 
transferred in the normal manner; but make .sure it 
is saved at the original tape low speed. 
STEP 2: Initialize BASIC on your SYM and LOAD 
and RUN the KIM BASIC PROGRAM LOADER. 
STEP 3: Play the tape with the KIM program in 
your recorder. If you have impiemenicd a second 
cassette control for your read-only recorder you will 
have to over-ride it since this program will only ac- 
tivate the original cassette control. 
STEP 4: After the LOADED message, enter the 
command printed by the program and then SAVE a 
copy of the KIM program in high speed format. In 
ease you get a BAD LOAD message, start over again 
at STEP 2. 

5YM/KIM BASIC Incompatlbllittes 

The obvious hardware related incompatibilities due 
to different address availability in the two systems re- 
quire careful use of the PEEK, POKE and USR 
commands. Of course, different terminals may also 
have special requirements for cursor controls or 
graphics capabilities. Not so obvious are the follow- 
ing additional potential problem areas, 
GO: SYM treats GO as a reserved word so don't 
enter GOTO as two words. Also make sure that GO 
does not appear in any variable names such as 
DRAGON. 

GET: SYM does not implement this function but it 
does reserve the same token as KIM. (See MICRO 
24:15 if you want to implement GET on your SYM.) 
USR: The multiple parameter versions of USR will 
not work on the KIM. The single jiarameter version 
will require a different set of POKE < ommands prior 
to the USR but otherwise it works the same in both 
systems. 

& "ABCD": KIM does not support hexidecimal 
notation. 



Februorv. 1981. Issue 9, 



COMPUTE! 



Ml 




BOX 120 

ALLAMUCHY, N.J. 07820 

201-362-6574 



HUDSON DIGITAL ELECTRONICS INC. 

THE TASK* MASTERS 

HDE supports the *TIM, AIM, SYM and KIM (TASK) with a growing line of computer programs and 
peripheral components. All HDE component boards are state-of-the-art 4Vz" x B'A", with on board 
regulation of all required voltages, fully compatible with the KIM-4 bus. 



OMNIDISK 65/8 and 65/5 

Single and dual drive 8" and 5V4" disk systems. 
Complete, ready to plug in, bootstrap and run. 
Include HDE's proprietary operating system, 
FODS (File Oriented Disk System). From $795.00. 



DM816-M8A 

An 8K static RAM board tested fora minimum of 
100 hours and warranted for a full 6 months. 
$195.00 



DM816-UB1 

A prototyping card with on-board 5V regulator 
and address selection. You add the application. 
$49.50 



DM81 6-P8 

A 4/8K EPROM card for 2708 or 271 6 circuits. 
On board regulation of all required voltages. 
Supplied without EPROMS. $165,00 



DMB16-CC15 

A 15 position motherboard mounted in a 19" 
RETMA standard card cage, with power supply. 
KIM, AIM and SYM versions. $545.00 



DISK PROGRAM LIBRARY 

Offers exchange of user contributed routines 
and programs for HDE Disk Systems. Contact 
Progressive Computer Software, Inc. for details. 

ORDER FROM THESE FINE DEALERS: 



HDE DISK BASIC 

A full range disk BASIC for KIM based systems. 
Includes PRINT USING, IF . . . THEN . . . ELSE. 
Sequential and random file access and much 
more. $175.00 

HDE ADVANCED INTERACTIVE 
DISASSEMBLER (AID) 

Two pass disassembler assigns labels and con- 
structs source files for any object program. 
Saves multiple files to disk. TIM, AIM, SYM, KIM 
versions. $95.00 

HDE ASSEMBLER 

Advanced, two pass assembler with standard 
mnemonics. KIM, TIM, SYM and KIM cassette 
versions. $75.00 {$80.00 cassette) 

HDE TEXT OUTPUT PROCESSING SYSTEM 
(TOPS) 

.A comprehensive text processor with over 30 
commands to format and output letters, docu- 
ments, manuscripts. KIM, TIM and KIM cassette 
versions. $135.00 ($142.50 cassette) 

HDE DYNAMIC DEBUGGING TOOL (DDT) 

Built in assembler/disassembler with program 
controlled single step and dynamic breakpoint 
entry/deletion. TIM, AIM, SYM, KIM AND KIM 
cassette versions. $65.00 ($68.50 cassette) 

HUE COMPREHENSIVE MEMORY TEST 
(CMT) 

Eight separate diagnostic routines for both 
static and dynamic memory. TIM, AIM, SYM, 
KIM and KIM cassette versions. $65.00 ($68.50 
cassette) 



Progressfve Compuler Software 
405 Corbin Road 
York, PA 1 7403 
(717) 845-4954 

Lux Associates 
20 Sunland Driy/e 
Chico, CA 95926 
(916) 343-5033 



Johnson computers 

Box 523 

Medina, Oti 10 44256 

(216) 725 4560 

A-B Computers 

115-B E, Stump Road 

Montgomeryville. PA 18936 

(215) 699-5826 



Fallt-BakerAssociates Perry Peripherals 

382 Franklin Avenue P.O. Box 924 

Nutley. NJ 071 10 Miller Place, NY 11764 

(201)661-2430 (516)744-6462 

Laboratory Microcomputer Consultants 
P.O Box 84 
East Amherst, NY 14051 
(716)689-7344 



142 



COMPUTE! 



February, 1981 issue 9. 



Theory Of Operation 

The key to the succoss ol' this scheme is in the fact 
that the Microsoft BASIC interpreters aulomatically 
recalculate the internal Hne pointers whenever a 
BASIC program is loaded. Theoretically, this means 
that a program that was originally saved at one ad- 
dress could be loaded into a different address if the 
tape load routine is given the ID value of SFF and 
the address where the program is to be loaded. The 
problem is that in .some versions of KIM BASIC the 
ID value of $FF is used to save programs which 
means that since the IDs match when loading, the 
programs get loaded into their original address in- 
stead of the new specified address. There are two 
ways to fi.x this problem. First, if you have access to 
the KIM you can change location $2744 from $FF to 
SOI before the progi-am is saved. This is part of the 
sequence LDA *SFF, STA $17F9. 

The second method is the one the KIM BASIC 
PROGRAM LOADER uses which will work with 
any ID. It requires making a copy of the beginning 
of the SYM Monitor Load routine on page one of 
the SYM up to the point where the ID test is made. 
The FOR/NEXT loop in the LOADER program 
copies the code between address $8C78 and $8C95 
and then an RTS instruction is attached to the end 
($60 = decimal 96). 

The juinp to continue into the Monitor Load 
routine is performed by an interesting technique 
which Hans W. Gschwind of West Germany wrote 
about in SYM-PHYSICS 4-20. It involves using the 
multi-parameter version of the USR function by 
pushing two return addresses on the stack so that 
when the first subroutine finishes it returns to the ad- 
dress equal to the third parameter of the USR com- 
mand plus one which is the continuation point in the 
Monitor Load routine. The ne.xt RTS instruction en- 
countered returns to the address of the second 
parameter plus one which is the normal return point 
for BASIC high-speed tape loads. 

With this background in mind it is possible to 
understand the following line by line explanation of 
the KIM BASIC PROGRAM LOADER. 

LINE 100: Calls the Monitor ACCESS routine to 
allow pas.sing of tape parameters lo System Ram. 
LINE 110: Passes tape start address of S201 and ID 
of $FF to tape parameters. 

LINES 120 to 140: Copies first part of Monitor 
Tape Load routine (o page one. 
LINE 150: Ends page one copy with an RTS. 
LINES 160 and 170: Prints message (o be entered 
after a good load. The command must be entered 
manually since the KIM BASIC program will over- 
write thi- LOADER [program. 

LINE 180: Jumps to address 300 (first ])arameter) 
with Y inde.\ register ccjual to zero (fourtii 
parameter) indicating KIM tape format. The RTS at 
address .'^30 jumps to address S8CAD (third 



parameter plus one). The RTS at the end of the 

Monitor Tape Load routine jumps to address $C6C6 
(second parameter plus one) in the BASIC inter- 
preter which modifies the line pointers to fit the new 
location in the SYM. 

Conclusion 

Hopefully this scheme can be used to advantage by 
anyone having access to both a SYM and a KIM. If 
you find that it just doesn't work for you, try a dif- 
ferent tape recorder. Mike and I spent many 
frustrating days trying to get the SYM to KIM 
transfer to work and it wasn't until I used a different 
recorder with my SYM before we finally did ha\'e 
success! Now we are able to transfer our BASIC pro- 
grams with ease. gf 



PROGRESSIVE COMPUTER SOFTWARE, INC. 

405 Corbin Rd., York, Pa. 17403 

(717)846-4954 

hivitci You To 

STEP INTO THE WORLD 

OF MACHINE LANGUAGE 

PROGKAMMING 

irith 

TEMA 2 

The most powerful mjthinc languaKf dfbugj^ing 
tool fvcr dfvelopfd for the APPLE II. Debug 
machine Ijnuuajjc as tMsily as BASIC. 

• Flexible inslruclion st-t 

■ Command input synta.x ediUvr 

• Totally invisible to the user program 

• Complete, in-deplh documenlalion 

• Unique, PCS stand.ird. sclt-paced 

• Trainer program 

• For 3.2 or 3.3 DOS 

We spfciatizc in syslrnis and nppUcntiou harilwart' 
for HDE mui APPLE products. 



February. 1981 Issue 9. 



COMPUTE! 



143 



AIM 65 




AIM 65 is fully assembled, tested and warranted. Wltti the 
addition of a low cost, readily available power supply, it's 
ready to start working for you. 

AIM 65 features on-board thermal printer and 
alphanumeric display, and a terminal-style keyboard, tt 
has an addressing capability up to 65K bytes, and comes 
with a user-dedicated 1K or 4K RAM. Two installed 4K 
ROMS hold a powerful Advanced Interface Monitor 
program, and three spare sockets are included to expand 
on-board ROM or PROM up to 20K bytes. 

An Application Connector provides for attaching a TTY 
and one or two audio cassette recorders, and gives exter- 
nal access to the user-dedicated general purpose I/O lines. 

Also included as standard are a comprehensive AIM 65 
User's Manual, a handy pocket reference card, an R6500 
Hardware Manual, an R6500 Programming Manual and an 
AIM 65 schematic. 

AIM 65 is packaged on two compact modules. The 
circuit module is 12 inches wide and 10 inches long, the 
keyboard module is 12 inches wide and 4 inches long. 
They are connected by a detachable cable. 

THERMAL PRINTER 

Most desired feature on low-cost microcomputer systems . . 

• Wide 20-column printout 

• Versatile 5 x 7 dot matrix format 

• Complete 64-character ASCII alphanumeric format 

• Fast 120 lines per minute 

• Quite thermal operation 

• Proven reliability 

Full-size alphanumeric keyboard 

Provides compatibility with system terminals . . . 

• Standard 54 key, terminal-style layout 

• 26 alphabetic characters 

• 10 numeric characters 

• 22 special characters 

• 9 control functions 

• 3 user-defined functions 

TRUE ALPHANUMERIC DISPLAY 
Provides legible and lengthy display . . . 

• 20 characters wide 

• 16-segment characters 

• High contrast monolithic characters 

• Complete 64-character ASCII alphanumeric format 



BY ROCKWELL INTERNATIONAL 



PROVEN R6500 MICROCOMPUTER SYSTEM DEVICES 

Reliable, high performance NMOS technology . . . 

• R6502 Central Processing Unit (CPU), operating at 1 
MHz. Has 65K address capability, 13 addressing modes 
and true index capability. Simple but powerful 56 
instructions. 

• ReadMfite Memory, using R2114 Static RAM devices. 
Available in IK byte and 4K byte versions. 

• 8K Monitor Program Memory, using R2332 Static ROM 
devices. Has sockets to accept additional 2332 ROM or 
2532 PROM devices, to expand on-board Program 
memory up to 20K bytes. 

• R6532 RAM-lnput/Ou(put-Timer (RIOT) combination 
device. Multipurpose circuit for AIM 65 Monitor functions. 

• Two R6522 Versatile Interface Adapter (VIA) devices, 
which support AIM 65 and user functions. Each VIA has 
two parallel and one serial 8-bit, bidirectional I/O ports, 
two 2-bit peripheral handshake control lines and two 
fully-programmable 16-bil interval timeryevenl counters. 

BUILT-IN EXPANSION CAPABILITY 

• 44-Pin Application Connector for peripheral add-ons 

• 44-Pin Expansion Connector has full system bus 

• Both connectors are KIM-1 compatible 

TTY AND AUDIO CASSETTE INTERFACES 

Standard interface to low-cost peripherals . . . 

• 20 ma. current loop TTY interface 

• Interface for two audio cassette recorders 

• Two audio cassette formats: ASCII KIM-1 compatible 
and binary, blocked file assembler compatible 

ROM RESIDENT ADVANCED INTERACTIVE MONITOR 

Advanced features found only on larger systems . . . 

• Monitor-generated prompts 

• Single keystroke commands 

• Address independent data entry 

• Debug aids 

• Error messages 

• Option and user Interface linkage 

ADVANCED INTERACTIVE MONITOR COMMANDS 

• Major Function Entry 

• Instruction Entry and Disassembly 

• Display/Alter Registers and Memory 

• Manipulate Breakpoints 

• Control Instruction/Trace 

• Control Peripheral Devices 

• Call User-Defined Functions 

• Comprehensive Text Editor 



$79,00 
99.00 
50.00 



LOW COST PLUG-IN OPTIONS 

• A65-010—4K Assembler— symbolic, two-pass 

• A65-020— 8K BASIC Interpreter 

• 3K RAM Expansion Kit 

POWER SUPPLY SPECIFICATIONS 

• -^5 VDC ± 5% regulated @ 2.0 amps (max) 

• +24 VDC ± 15% unregulated @ 2.5 amps (peak) 
0.5 amps average 

PRICE: $389.00(iK RAM) 

Plus $4.00 UPS (shipped in U.S. must give street address), 
$10 parcel post to APO's, FPO's, Alaska, Hawaii. All Inter- 
national customers write lor ordering information. 
We manufacture a complete line of high quality expansion 
boards. Use reader sen/ice card to be added to our mailing 
list, or U.S. residents send $1.00 (International send $3.00 
U.S.) for airmail delivery of our complete catalog. 




ENTERPRISES 

INCORPORATED 



2951 W. Fairmount Avenue 

Pfioenix AZ 85017 
(602)265-7564 







144 



COMPUTE! 



fobruary, 1<?81. Issue 9. 



Advertisers' 
Index 



Aardvark Technical Services 89 

A B Computers 33 

Abacus Software 32,117 

Adventure international 71 

Anderson Peripherais, inc 81 

Andromeda, inc 69 

Applied fvlicrosystems 125 

Beta Computer Devices 41 

R, J, Braclnman Associates, inc 51 

CGRS Microtecii 105 

CiviS Software Systems, Inc 10,11,111,115 

Edward H. Carlson 95 

Cognitive Products 57 

Color Computer Concepts 80 

Commodore Business fvlacfiines BC 

Competitive Software 39 

Compumart IBC 

Computer House Division 43,57,117 

Computer IVlail Order 63 

Computer Plus 37 

Connecticut microcomputer 44,45 

Cursor 121 

Cyberia, Inc 41 

Dr. Daley's Software lOl 

Dynacomp 25 

Eastern House Software 21,119 

ECX Computer Company 57 

Educational Computer Magazine 39 

Electronic Specialists, Inc 52 

ETC Corporation 49 

Falk-Baker Associates 135 

FSS 31,32,111 

Hepburn MCA 133 

House of Computers, Inc 43 

Howard Industries 27 

Howard Software Services 13 

Hudson Digital Electronics, Inc 141 

Human Engineered Software 103 

Huntington Computing 73 

Image Computer Products 14,73 

Innerface Business Systems 65 

Instant Software 122,123 

Iridis 9 



Jini Micro Systems 9,96 

Kobetek Systems, Ltd 108 

LemData Products ill 

Madison Computer 63 

Charles Mann & Associates 8 

Matrix Software 21 

Micro Computer Industries, Ltd 15 

Micro-Ed, Inc 55 

Micro Mini Computer World 17 

Microphys Programs 117,121 

Microsoft Consumer Products 2 

Micro Technology Unltd 47,131 

Microtek 61 

Mosaic Electronics 85 

Mountain Computer IPC 

New England Electronics Co 22,23 

Omega Sales Co 53 

Optimal Technology 8 

Optimized Data Systems 117 

Pacific Exchanges 32,59 

Perry Peripherals 133 

Petted Micro Systems 120 

Powersoft 43 

Professional Software, Inc 1 

Program Design, Inc 79 

Progressive Computing Software 142 

Prominico 119 

Quality Software 67,77 

Rehnke Software Enterprises 139 

Bob Retelle 95 

RNB Enterprises 143 

Howard Sams Company 7 

Scott Foresman & Company 35 

Seawell Microsystems 129 

Skyles Electric Works 99,106,107,108 

Small Business Computer Systems 21 

The Software Exchange 29 

Swifty Software 79,81 

Systems Formulate Corp 28 40 

T.H.E.S.LS 83 

TIS 113 

TNW Corporation 121 

Universal Output Supply 28 

Virginia Micro Systems 121 




COMPUMART 

LETS YOU 

PUT APPLE ON TRIAL 

WITH OUR EXCLUSIVE lO-DAY FREE RETURN ON ALL 
THESE GREAT APPLE COMPUTERS AND ACCESSORIES. 



CompuMarl caines complete lines ol 

microcomputers from Apple to Zenith, 

as well as thousands of microcomputer 

peripherals and accessoties, Write lor 

our FREE 36 page catalog 

Apple Computer 

We carry the most complete inventory 

ol Apple computers, peripherals, and 

software. CALL! 

OurCr:ii:-l!!iab .".pple Special 

over S250 on our most popular Apple 

System, System includes a 48K Apple 11 

Apple Disk & Controller, and a Sup R 

Mod RF Modulator. 

Ust, $2,020 

Compumart Sale Price: $1,769 

New from Apple tor the Apple 11 

DOS 3-3 Convert disks to 16 sector 

lormat for 23% more storage and 

faster access $60 



Apple Plot. The perlect graphic com- 
plement lor Vislcdlc $70 

Dow Jones News & Quotes S95 

Adventure (Uses 48K) $35 

DOS Tool Kit $75 

Apple Fortran S200 

Silentype Printer w/Xlace $595 

VisiCGlc $149 

Tax Planner $120 

From Symtech & Info Unlimited 
Super Sound Generator. , (mono) $159 
(stereo) S259 

Light Pen $249 

X-IO Controller (plugs into paddle 

port) $49 

Apple Sync Controller , $49 

From Personal Soltware 

VisiCQlc $149 

Desk top plan $99 




New ;;.-r;: Videx' — Video Term 

80 Col. X 24 line 

7x9 motnx, plug in compatible board 

for the Apple 11. Price $325 

without graphics EPROM. 
With graphics EPROM $350, 

New Horn MUSE 

The Voice $39,95 

Super Text S99.00 

Address Book $49.95 

Mountain Hardware - Expansion 
accessories tor your Apple 

Inlrol/XlO System $289 

Super Talker $299 

The Music System $545 

ROM plus board w/keyboard 

filter $199 

Clock Calendar S280 

16 Channel A to D Converter $350 

Apple Expansion Chassis $650 

ROM Writer $175 

Miscellaneous Apple 11 Accessories 
Easy Water (80 col, need Videx) . $249 

Easy Mover . $49 

Easy Mailer $69 

Dysan Diskettes ea $5 

S.SM, Serial & Parallel Apple 

Interlace $225 

ABTs Numeric Key Pad SUO 



270 THIRD ST. DEPT SOlCOMPU MART CAMBRIDGE, MA 02 142 

iTOLL FREE 1-800-343-5504 ^^ IN MASS 617-491-2700 

[appki computer 

Authorized Deater 




TheGfeat 
American Sohition 

Machine. 



Meet Commodore. The busi- 
ness computer thafs providing 
solutions for more than 100,000 
people all over the world. Built 
by one of the pioneers in office 
machines. With a reputation for 
quality that can only come from 
vertical integration of the total 
manufacturing process. Commo- 
dore builds, not assembles. 

Compare Commodore's word 
and data processing capabilities 
with computers costing twice or 
even three times as much. You'll 
see why so many small busi- 
nesses are turning to Commodore 
for solutions to problems as var- 
ied as these: 

D A car leasing company's cus- 
tomers were terminating too early 
for account profitability. Solu- 
tion: A 16K Commodore. It 
analyzes cash flow on over 1200 
accounts, identifies those for 
early penalties, and even writes 
up lease contracts. Commodore 
paid for itself within weeks. 
n A law firm needed a high 
quality, easy-to-use, affordable 
word processing system. 
Solution: Commodore plus 
its WordPro software pack- 



age. At a $6,000 savings. 
D A gasoline retailer needed to 
inventory, order and set prices; 
determine Federal and state 
income taxes; and comply with 
Federal pricing and allocation 
regulations. All done daily, 
weekly, monthly and yearly. 
Solution: Commodore. It keeps 
his business on track— and Uncle 
Sam off his back. 
D A paint and wallpaper store 
had to inventory over 600 expen- 
sive wallpaper lines for 
profitability, monitor distributor 
sales, set and track salesmen's 
goals, and help the customer 
select the right size, pattern and 
quantity. Solution: Two 32K 

Commodore com- 
puters, floppy 
disk and 
printer. 
Commodore 
does it all — 
and account- 
ing, too. 

In applica- 
tions like 
these. 




and many more, Commodore 
solves the problems that stand in 
the way of increased jprofitability. 
Commodore can provide the solu- 
tion in your Great American bus- 
iness, too. Find out more by call- 
ing or writing any of Commo- 
dore's District Sales Offices. 
COSTA MESA, CA 2955 N. Air- 
way Avenue 92626. (714) 979-6307. 
SANTA CLARA, CA3330 Scott 
Boulevard 95051. (408) 727-1130 
DECATUR, GA 5360 Snapfinger 
Woods Drive 30035. (404) 987-3311. 
BENSENVILLE, IL 790 Maple 
Lane 6O106. (312) 595-5990. 
NORRISTOWN, PA 
950 Rittenhouse Road 19401. 
(215) 666-7950. 

DALLAS, TX 4350 Beltwood 
Parkway South 75234. 
(214) 387-0006. 

Commodore Business Machines, 
Inc., Computer Sales Division, 
Valley Forge Corporate Center. 
950 Ritten- 
house Road, 
Norristown, 
PA 19401.